diff options
Diffstat (limited to 'configmgr')
78 files changed, 20641 insertions, 0 deletions
diff --git a/configmgr/JunitTest_configmgr_unoapi.mk b/configmgr/JunitTest_configmgr_unoapi.mk new file mode 100644 index 000000000000..3f1537fd8cc2 --- /dev/null +++ b/configmgr/JunitTest_configmgr_unoapi.mk @@ -0,0 +1,50 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen@canonical.com> +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_JunitTest_JunitTest,configmgr_unoapi,SRCDIR)) + +$(eval $(call gb_JunitTest_set_defs,configmgr_unoapi,\ + $$(DEFS) \ + -Dorg.openoffice.test.arg.sce=$(SRCDIR)/configmgr/qa/unoapi/module.sce \ + -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/configmgr/qa/unoapi/knownissues.xcl \ + -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/configmgr/qa/unoapi/testdocuments \ +)) + +$(eval $(call gb_JunitTest_add_jars,configmgr_unoapi,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ +)) + +$(eval $(call gb_JunitTest_add_classes,configmgr_unoapi,\ + org.openoffice.test.UnoApiTest \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/configmgr/Makefile b/configmgr/Makefile new file mode 100644 index 000000000000..8d71119918b6 --- /dev/null +++ b/configmgr/Makefile @@ -0,0 +1,39 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +ifeq ($(strip $(SOLARENV)),) +$(error No environment set!) +endif + +gb_PARTIALBUILD := T +GBUILDDIR := $(SOLARENV)/gbuild +include $(GBUILDDIR)/gbuild.mk + +$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) + +# vim: set noet sw=4 ts=4: diff --git a/configmgr/Module_configmgr.mk b/configmgr/Module_configmgr.mk new file mode 100644 index 000000000000..0481c29c50ed --- /dev/null +++ b/configmgr/Module_configmgr.mk @@ -0,0 +1,35 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen@canonical.com> +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_Module_Module,configmgr)) + +$(eval $(call gb_Module_add_subsequentcheck_targets,configmgr,\ + JunitTest_configmgr_unoapi \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/configmgr/inc/makefile.mk b/configmgr/inc/makefile.mk new file mode 100755 index 000000000000..3dd2fc4d4811 --- /dev/null +++ b/configmgr/inc/makefile.mk @@ -0,0 +1,38 @@ +#************************************************************************* +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General 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 = inc + +ENABLE_EXCEPTIONS = TRUE +VISIBILITY_HIDDEN = TRUE + +.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 new file mode 100644 index 000000000000..b06c3f4384e4 --- /dev/null +++ b/configmgr/inc/pch/precompiled_configmgr.cxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/inc/pch/precompiled_configmgr.hxx b/configmgr/inc/pch/precompiled_configmgr.hxx new file mode 100644 index 000000000000..af05be7c03d3 --- /dev/null +++ b/configmgr/inc/pch/precompiled_configmgr.hxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 + +#include "sal/config.h" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst new file mode 100644 index 000000000000..962e2bc648ff --- /dev/null +++ b/configmgr/prj/build.lst @@ -0,0 +1,5 @@ +cg configmgr : BOOST:boost LIBXSLT:libxslt comphelper cppu cppuhelper offapi sal salhelper stlport xmlreader NULL +cg configmgr\inc nmake - all cg_inc NULL +cg configmgr\source nmake - all cg_source cg_inc NULL +# migrated to gbuild +#cg configmgr\qa\unoapi nmake - all cg_qa_unoapi NULL diff --git a/configmgr/prj/d.lst b/configmgr/prj/d.lst new file mode 100644 index 000000000000..e2eac0f7bf0c --- /dev/null +++ b/configmgr/prj/d.lst @@ -0,0 +1,4 @@ +..\%__SRC%\bin\configmgr.uno.dll %_DEST%\bin\configmgr.uno.dll +..\%__SRC%\lib\configmgr.uno.dylib %_DEST%\lib\configmgr.uno.dylib +..\%__SRC%\lib\configmgr.uno.so %_DEST%\lib\configmgr.uno.so +..\%__SRC%\misc\configmgr.component %_DEST%\xml\configmgr.component diff --git a/configmgr/qa/unit/data.xcd b/configmgr/qa/unit/data.xcd new file mode 100755 index 000000000000..cd1cdd3a63d0 --- /dev/null +++ b/configmgr/qa/unit/data.xcd @@ -0,0 +1,5177 @@ +<?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: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"> + <node oor:name="dotuno:WebHtml" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Preview in Web Browser</value> + </prop> + </node> + <node oor:name="dotuno:NewPresentation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">New Presentation</value> + </prop> + </node> + <node oor:name=".uno:FontworkGalleryFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fontwork Gallery</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fontwork Shape</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkSameLetterHeights" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fontwork Same Letter Heights</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkAlignmentFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fontwork Alignment</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkCharacterSpacingFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fontwork Character Spacing</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Basic Shapes</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Symbol Shapes</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Block Arrows</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowcharts</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Callouts</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Stars</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.rectangle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rectangle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.round-rectangle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rectangle, Rounded</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.quadrat" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Square</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.round-quadrat" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Square, Rounded</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.circle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.ellipse" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.circle-pie" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle Pie</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.isosceles-triangle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Isosceles Triangle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.right-triangle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right Triangle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.trapezoid" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Trapezoid</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.diamond" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Diamond</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.parallelogram" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Parallelogram</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.pentagon" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Regular Pentagon</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.hexagon" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Hexagon</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.octagon" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Octagon</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.cross" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cross</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.ring" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ring</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.block-arc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Block Arc</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.can" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cylinder</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.cube" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cube</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.paper" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Folded Corner</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicShapes.frame" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Frame</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.smiley" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Smiley Face</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.sun" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sun</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.moon" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Moon</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.lightning" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Lightning Bolt</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.heart" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Heart</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.flower" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flower</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.cloud" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cloud</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.forbidden" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">"Prohibited" Symbol</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.puzzle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Puzzle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.bracket-pair" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Double Bracket</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.left-bracket" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left Bracket</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.right-bracket" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right Bracket</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.brace-pair" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Double Brace</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.left-brace" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left Brace</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.right-brace" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right Brace</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.quad-bevel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Square Bevel</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.octagon-bevel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Octagon Bevel</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SymbolShapes.diamond-bevel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Diamond Bevel</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.left-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.right-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.down-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Down Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.left-right-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left and Right Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-down-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up and Down Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-right-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up and Right Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-right-down-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up, Right and Down Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.quad-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">4-way Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.corner-right-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Corner Right Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.split-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Split Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.striped-right-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Striped Right Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.notched-right-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Notched Right Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.pentagon-right" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Pentagon</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.chevron" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Chevron</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.right-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.left-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.down-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Down Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.left-right-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left and Right Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-down-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up and Down Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.up-right-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Up and Right Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.quad-arrow-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">4-way Arrow Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.circular-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circular Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.split-round-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right or Left Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ArrowShapes.s-sharped-arrow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">S-shaped Arrow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-process" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Process</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-alternate-process" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Alternate Process</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-decision" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Decision</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-data" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Data</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-predefined-process" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Predefined Process</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-internal-storage" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Internal Storage</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-document" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Document</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-multidocument" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Multidocument</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-terminator" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Terminator</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-preparation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Preparation</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-manual-input" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Manual Input</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-manual-operation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Manual Operation</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-connector" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Connector</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-off-page-connector" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Off-page Connector</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-card" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Card</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-punched-tape" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Punched Tape</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-summing-junction" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Summing Junction</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-or" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Or</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-collate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Collate</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-sort" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Sort</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-extract" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Extract</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-merge" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Merge</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-stored-data" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Stored Data</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-delay" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Delay</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-sequential-access" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Sequential Access</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-magnetic-disk" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Magnetic Disc</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-direct-access-storage" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Direct Access Storage</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FlowChartShapes.flowchart-display" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flowchart: Display</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.rectangular-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rectangular Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.round-rectangular-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rounded Rectangular Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.round-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Round Callout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.cloud-callout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cloud</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.line-callout-1" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Callout 1</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.line-callout-2" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Callout 2</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CalloutShapes.line-callout-3" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Callout 3</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.bang" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Explosion</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.star4" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">4-Point Star</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.star5" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">5-Point Star</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.star6" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">6-Point Star</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.star8" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">8-Point Star</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.star12" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">12-Point Star</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.star24" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">24-Point Star</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.concave-star6" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">6-Point Star, concave</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.vertical-scroll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Vertical Scroll</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.horizontal-scroll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Horizontal Scroll</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.signet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Signet</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StarShapes.doorplate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Doorplate</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-plain-text" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Plain Text</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-wave" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Wave</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-inflate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Inflate</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-stop" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Stop</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-curve-up" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Curve Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-curve-down" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Curve Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-triangle-up" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Triangle Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-triangle-down" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Triangle Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-fade-right" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fade Right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-fade-left" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fade Left</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-fade-up" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fade Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-fade-down" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fade Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-slant-up" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Slant Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-slant-down" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Slant Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-fade-up-and-right" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fade Up and Right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-fade-up-and-left" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fade Up and Left</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-chevron-up" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Chevron Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-chevron-down" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Chevron Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-up-curve" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Up (Curve)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-down-curve" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Down (Curve)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-left-curve" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Left (Curve)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-right-curve" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Right (Curve)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-circle-curve" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle (Curve)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-open-circle-curve" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Open Circle (Curve)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-up-pour" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Up (Pour)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-down-pour" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Down (Pour)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-left-pour" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Left (Pour)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-arch-right-pour" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arch Right (Pour)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-circle-pour" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle (Pour)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontworkShapeType.fontwork-open-circle-pour" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Open Circle (Pour)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:UndoAction" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Can't Undo</value> + </prop> + </node> + <node oor:name=".uno:GrabControlFocus" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Control Focus</value> + </prop> + </node> + <node oor:name=".uno:ScrollBar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Scrollbar</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Zoom" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Zoom...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SpinButton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Spin Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ConvertToScrollBar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Scrollbar</value> + </prop> + </node> + <node oor:name=".uno:ConvertToSpinButton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Spin Button</value> + </prop> + </node> + <node oor:name=".uno:ConvertToNavigationBar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Navigation Bar</value> + </prop> + </node> + <node oor:name=".uno:ToggleBreakPoint" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Breakpoint On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Text" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LaunchStarImage" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Start Image Editor</value> + </prop> + </node> + <node oor:name=".uno:AddWatch" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Enable Watch</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CharFontName" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Font Name</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChooseMacro" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Macro</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Italic" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Italic</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Bold" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Bold</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ModuleDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Module</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Shadowed" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Shadow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ObjectCatalog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Object Catalog</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineFont" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Outline</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Strikeout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Strikethrough</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HelpOnHelp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Help on Help</value> + </prop> + </node> + <node oor:name=".uno:Underline" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Underline</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HelpIndex" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">%PRODUCTNAME ~Help</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontHeight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Font Size</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtendedHelp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">What's ~This?</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ActiveHelp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Extended Tips</value> + </prop> + </node> + <node oor:name=".uno:Color" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Font Color</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HelpTip" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Tips</value> + </prop> + </node> + <node oor:name=".uno:MatchGroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Find Parenthesis</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicIDEAppear" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Edit Macros</value> + </prop> + </node> + <node oor:name=".uno:LibSelector" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Current Library</value> + </prop> + </node> + <node oor:name=".uno:LeftPara" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Align Left</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>3</value> + </prop> + </node> + <node oor:name=".uno:RightPara" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Align Right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>3</value> + </prop> + </node> + <node oor:name=".uno:CenterPara" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Centered</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>3</value> + </prop> + </node> + <node oor:name=".uno:SendFax" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Send Default Fax</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:JustifyPara" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Justified</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:HelpChooseFile" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Choose Help File</value> + </prop> + </node> + <node oor:name=".uno:SpacePara1" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Spacing: 1</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:SpacePara15" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Spacing : 1.5</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:SpacePara2" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Spacing : 2</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:StatusGetPosition" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Position</value> + </prop> + </node> + <node oor:name=".uno:StatusGetTitle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Current Basic Module</value> + </prop> + </node> + <node oor:name=".uno:ManageBreakPoints" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Manage Breakpoints</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:TransformDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Position and Si~ze...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafLuminance" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Brightness</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafContrast" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Contrast</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomToolBox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafRed" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Red</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomPlus" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom In</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafGreen" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Green</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomIn" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom Out</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomMinus" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom Out</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafBlue" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Blue</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OptionsTreeDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Options...</value> + </prop> + </node> + <node oor:name=".uno:Zoom100Percent" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom 100%</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafGamma" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Gamma</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomPage" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom Page</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafTransparence" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Transparency</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomOptimal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Optimal</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafInvert" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Invert</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Line" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GrafMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Graphics mode</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Line_Diagonal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line (45°)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Rect" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rectangle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Rect_Rounded" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rectangle, Rounded</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Ellipse" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BibliographyComponent" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Bibliography Database</value> + </prop> + </node> + <node oor:name=".uno:Pie" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse Pie</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierEliminatePoints" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Eliminate Points</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DatasourceAdministration" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Data Sources...</value> + </prop> + </node> + <node oor:name=".uno:GrafAttrCrop" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Crop</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NewDoc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">New Document From Template</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Arc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arc</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Open" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Open...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CircleCut" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle Segment</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SaveAs" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Save ~As...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CloseDoc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Close</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Print" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Print...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierFill" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Curve, Filled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Save" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Save</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierInsert" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert Points</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierDelete" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Delete Points</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierMove" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Points</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Reload" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Reload</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierClose" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Close Bézier</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:PrintDefault" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Print File Directly</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierSmooth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Smooth Transition</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ToggleObjectBezierMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Poi~nts</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertAnnotation" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Not~e</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierCutLine" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Split Curve</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SelectObject" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ToggleObjectRotateMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Rotate</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ObjectAlignLeft" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Left</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AlignCenter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Centered</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ObjectAlignRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AlignUp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Top</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AlignMiddle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">C~enter</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AlignDown" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Bottom</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:VerticalText" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Vertical Text</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:VerticalCaption" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Vertical Callouts</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:TextdirectionLeftToRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text direction from left to right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:TextdirectionTopToBottom" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text direction from top to bottom</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertObjectChart" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Chart...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DefaultBullet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Bullets On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:FormatArea" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">A~rea...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormatLine" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">L~ine...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChangeCaseToUpper" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Uppercase</value> + </prop> + </node> + <node oor:name=".uno:ChooseControls" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert Controls</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChangeCaseToLower" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Lowercase</value> + </prop> + </node> + <node oor:name=".uno:ChangeCaseToHalfWidth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">H~alf-width</value> + </prop> + </node> + <node oor:name=".uno:InsertDoc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~File...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertPushbutton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChangeCaseToFullWidth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Full-width</value> + </prop> + </node> + <node oor:name=".uno:DefaultNumbering" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Numbering On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:BezierConvert" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Convert to Curve</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Stop" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Stop Loading</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Radiobutton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Option Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChangeCaseToHiragana" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Hiragana</value> + </prop> + </node> + <node oor:name=".uno:BezierEdge" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Corner Point</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Checkbox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Check Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChangeCaseToKatakana" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Katakana</value> + </prop> + </node> + <node oor:name=".uno:SetDocumentProperties" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Propert~ies...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BezierSymmetric" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Symmetric Transition</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineUp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AddDirect" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~New</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineDown" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SaveAsTemplate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Save...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineLeft" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Promote</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DesignerDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">St~yles and Formatting</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Demote</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Organizer" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Organize...</value> + </prop> + </node> + <node oor:name=".uno:OutlineFormat" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Formatting On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineCollapseAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">First Level</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineBullet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Bullets and Numbering...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:EditDoc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Edit File</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertImageControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Image Control</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BrowseView" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Web Layout</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ProgressBar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Progress Bar</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:PlugInsActive" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">P~lug-in</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HFixedLine" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Horizontal Line</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FileDocument" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">File Document</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:VFixedLine" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Vertical Line</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ChoosePolygon" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Symbol Selection</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ShowBrowser" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Display Properties</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FillStyle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Area Style / Filling</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotAddressDataSource" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoPilot: Address Data Source</value> + </prop> + </node> + <node oor:name=".uno:FillColor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fill Color</value> + </prop> + </node> + <node oor:name=".uno:StyleApply" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Apply Style</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AddDateField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Date Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertTimeField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Time Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StyleNewByExample" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">New Style from Selection</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:XLineStyle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Style</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertNumericField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Numeric Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StyleUpdateByExample" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Update Style</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineDash" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Dash/Dot</value> + </prop> + </node> + <node oor:name=".uno:InsertCurrencyField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Currency Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineWidth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Width</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertFormattedField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Formatted Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:XLineColor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Color</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertPatternField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Pattern Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertFileControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">File Selection</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertTreeControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Tree Control</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ShowPropBrowser" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Properties</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertObject" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~OLE Object...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertObjectFloatingFrame" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Float~ing Frame</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:EnterGroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Enter Group</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LeaveGroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">E~xit group</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HideDetail" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Hide Details</value> + </prop> + </node> + <node oor:name=".uno:ZoomPageWidth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom Page Width</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ShowDetail" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Show Details</value> + </prop> + </node> + <node oor:name=".uno:ZoomObjects" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Object Zoom</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ParaLeftToRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left-To-Right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>3</value> + </prop> + </node> + <node oor:name=".uno:Group" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Group...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ParaRightToLeft" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right-To-Left</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>3</value> + </prop> + </node> + <node oor:name=".uno:Ungroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Ungroup...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BackgroundColor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Background Color</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BackgroundPatternController" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Background Pattern</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OpenHyperlinkOnCursor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Open Hyperlink</value> + </prop> + </node> + <node oor:name=".uno:OpenSmartTagMenuOnCursor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Open Smart Tag Menu</value> + </prop> + </node> + <node oor:name=".uno:StyleCatalog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Catalog...</value> + </prop> + </node> + <node oor:name=".uno:InsertImage" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert from Image Editor</value> + </prop> + </node> + <node oor:name=".uno:SetBorderStyle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Borders</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertMath" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Formula...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertFixedText" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Label field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ObjectMenue" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ob~ject</value> + </prop> + </node> + <node oor:name=".uno:Groupbox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Group Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OpenXMLFilterSettings" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~XML Filter Settings...</value> + </prop> + </node> + <node oor:name=".uno:InsertEdit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HangulHanjaConversion" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Hangul/Hanja Conversion...</value> + </prop> + </node> + <node oor:name=".uno:ChineseConversion" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Chinese translation...</value> + </prop> + </node> + <node oor:name=".uno:InsertListbox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">List Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Combobox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Combo Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Spinbutton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Spin Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HScrollbar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Horizontal Scroll Bar</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:VScrollbar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Vertical Scroll Bar</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Preview" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Preview</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:URLButton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">URL Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ModifiedStatus" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Document Modified</value> + </prop> + </node> + <node oor:name=".uno:SelectMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:IsLoading" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Load Document</value> + </prop> + </node> + <node oor:name=".uno:TestMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Test Mode On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineStyle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Style</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FrameLineColor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Line Color (of the border)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OpenTemplate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Edit...</value> + </prop> + </node> + <node oor:name=".uno:OpenUrl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Load URL</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertSpreadsheet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sp~readsheet</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert Mode</value> + </prop> + </node> + <node oor:name=".uno:Size" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Size</value> + </prop> + </node> + <node oor:name=".uno:StateTableCell" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cell</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotMenu" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Wizards</value> + </prop> + </node> + <node oor:name=".uno:OutlineCollapse" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Hide Subpoints</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineExpandAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">All Levels</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OutlineExpand" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Show Subpoints</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NewWindow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~New Window</value> + </prop> + </node> + <node oor:name=".uno:ClearOutline" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Remove</value> + </prop> + </node> + <node oor:name=".uno:HelplinesMove" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Helplines While Moving</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CloseWin" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Close Window</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GridUse" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Snap to Grid</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertTextFrame" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert Text Frame</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FullScreen" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">F~ull Screen</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertGraphic" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~From File...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AutoFormat" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Auto~Format...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SpellDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Spellcheck...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertDraw" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Show Draw Functions</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NewFrameSet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">New FrameSet</value> + </prop> + </node> + <node oor:name=".uno:Thesaurus" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Thesaurus...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DrawText" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DrawCaption" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Callouts</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontWork" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">F~ontwork</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SaveAsUrl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Save Document As URL</value> + </prop> + </node> + <node oor:name=".uno:ObjectForwardOne" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Forward One</value> + </prop> + </node> + <node oor:name=".uno:ObjectBackOne" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Back One</value> + </prop> + </node> + <node oor:name=".uno:EditFrameSet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Edit FrameSet</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SplitHorizontal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Split Frame Horizontally</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SplitVertical" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Split Frame Vertically</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SplitParentHorizontal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Split FrameSet Horizontally</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SplitParentVertical" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Split FrameSet Vertically</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ModifyFrame" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Frame Properties</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DeleteFrame" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Delete Frame</value> + </prop> + </node> + <node oor:name=".uno:SetObjectToBackground" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">To Background</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SetObjectToForeground" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">To Foreground</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertLabels" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert Labels</value> + </prop> + </node> + <node oor:name=".uno:InsertBusinessCard" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert business cards</value> + </prop> + </node> + <node oor:name=".uno:InsertPlugin" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Plug-in...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BringToFront" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Bring to Front</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertApplet" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Applet...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SendToBack" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Send to Back</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SourceView" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">HT~ML Source</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertSound" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Sound...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InsertVideo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Video...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HyperlinkDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Hyperlink</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Merge" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Merge</value> + </prop> + </node> + <node oor:name=".uno:Substract" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Subtract</value> + </prop> + </node> + <node oor:name=".uno:SuperScript" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Superscript</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Intersect" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">I~ntersect</value> + </prop> + </node> + <node oor:name=".uno:SubScript" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Subscript</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FontDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">C~haracter...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DistributeSelection" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Distribution...</value> + </prop> + </node> + <node oor:name=".uno:ParagraphDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">P~aragraph...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FillShadow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Shadow</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LineEndStyle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Arrow Style</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Redo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Can't Restore</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Undo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Can't Undo</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormatPaintbrush" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Format Paintbrush</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Repeat" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Repeat</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ClearHistory" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Delete History</value> + </prop> + </node> + <node oor:name=".uno:Cut" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Cu~t</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Copy" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Copy</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Paste" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Paste</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Delete" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Delete C~ontents...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:TwainSelect" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Select Source...</value> + </prop> + </node> + <node oor:name=".uno:TwainTransfer" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Request...</value> + </prop> + </node> + <node oor:name=".uno:Select" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select ~All</value> + </prop> + </node> + <node oor:name=".uno:ContourDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Edit Contour...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SelectAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select ~All</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoDown" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Down</value> + </prop> + </node> + <node oor:name=".uno:GoUp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Up</value> + </prop> + </node> + <node oor:name=".uno:GoLeft" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Left</value> + </prop> + </node> + <node oor:name=".uno:GoRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Move Right</value> + </prop> + </node> + <node oor:name=".uno:GoDownBlock" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Page Down</value> + </prop> + </node> + <node oor:name=".uno:GoUpBlock" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Page Up</value> + </prop> + </node> + <node oor:name=".uno:BmpMask" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Eyedropper</value> + </prop> + </node> + <node oor:name=".uno:GoLeftBlock" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Page Left</value> + </prop> + </node> + <node oor:name=".uno:FrameSpacing" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">FrameSet Spacing</value> + </prop> + </node> + <node oor:name=".uno:GoToEndOfData" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">To File End</value> + </prop> + </node> + <node oor:name=".uno:GoToStart" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">To File Begin</value> + </prop> + </node> + <node oor:name=".uno:GoToStartOfRow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">To Document Begin</value> + </prop> + </node> + <node oor:name=".uno:GoToEndOfRow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">To Document End</value> + </prop> + </node> + <node oor:name=".uno:Navigator" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Navigator</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RestoreEditingView" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Restore Editing View</value> + </prop> + </node> + <node oor:name=".uno:BasicBreak" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Interrupt Macro</value> + </prop> + </node> + <node oor:name=".uno:TextFitToSize" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Fit to Frame</value> + </prop> + </node> + <node oor:name=".uno:ImageMapDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">ImageMap</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoDownSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Down</value> + </prop> + </node> + <node oor:name=".uno:GoUpSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Up</value> + </prop> + </node> + <node oor:name=".uno:GoLeftSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Left</value> + </prop> + </node> + <node oor:name=".uno:GoRightSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Right</value> + </prop> + </node> + <node oor:name=".uno:GoDownBlockSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Page Down</value> + </prop> + </node> + <node oor:name=".uno:GoUpBlockSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Page Up</value> + </prop> + </node> + <node oor:name=".uno:Rect_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rectangle, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Rect_Rounded_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rounded Rectangle, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoLeftBlockSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select Page Left</value> + </prop> + </node> + <node oor:name=".uno:Square" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Square</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Square_Rounded" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rounded Square</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoToStartSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select to File Begin</value> + </prop> + </node> + <node oor:name=".uno:Square_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Square, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Square_Rounded_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Rounded Square, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoToEndOfDataSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select to File End</value> + </prop> + </node> + <node oor:name=".uno:Ellipse_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoToStartOfRowSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select to Document Begin</value> + </prop> + </node> + <node oor:name=".uno:Circle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GoToEndOfRowSel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Select to Document End</value> + </prop> + </node> + <node oor:name=".uno:Circle_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Pie_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse Pie, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CirclePie" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle Pie</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CirclePie_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle Pie, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CircleArc" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle Arc</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CircleCut_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Circle Segment, Unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:EllipseCut" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse Segment</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:EllipseCut_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Ellipse Segment, unfilled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Polygon_Diagonal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Polygon (45°), Filled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Polygon_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Polygon</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Polygon_Diagonal_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Polygon (45°)</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Bezier_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Curve</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomNext" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom Next</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ZoomPrevious" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Zoom Previous</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GridVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Display Grid</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Flash" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Flash</value> + </prop> + </node> + <node oor:name=".uno:ToolsMacroEdit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Edit Macros</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:InternetDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Internet Options</value> + </prop> + </node> + <node oor:name=".uno:ColorControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Color Bar</value> + </prop> + </node> + <node oor:name=".uno:AutoCorrectDlg" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~AutoCorrect...</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotPresentations" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoPilot: Presentation</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotAgenda" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoPilot: Agenda</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotFax" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoPilot: Fax</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotLetter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoPilot: Letter</value> + </prop> + </node> + <node oor:name=".uno:VersionDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Versions...</value> + </prop> + </node> + <node oor:name=".uno:AutoPilotMemo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoPilot: Memo</value> + </prop> + </node> + <node oor:name=".uno:CompareDocuments" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Co~mpare Document...</value> + </prop> + </node> + <node oor:name=".uno:MergeDocuments" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Merge Document...</value> + </prop> + </node> + <node oor:name=".uno:SwEditOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text Document Options</value> + </prop> + </node> + <node oor:name=".uno:SdEditOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Presentation Options</value> + </prop> + </node> + <node oor:name=".uno:ScEditOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Spreadsheet Options</value> + </prop> + </node> + <node oor:name=".uno:SmEditOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Formula Options</value> + </prop> + </node> + <node oor:name=".uno:SchEditOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Chart Options</value> + </prop> + </node> + <node oor:name=".uno:SimEditOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Image Options</value> + </prop> + </node> + <node oor:name=".uno:FrameName" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Name</value> + </prop> + </node> + <node oor:name=".uno:FrameContent" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Contents</value> + </prop> + </node> + <node oor:name=".uno:GetColorTable" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Color Palette</value> + </prop> + </node> + <node oor:name=".uno:ExportTo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Expor~t...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SdGraphicOptions" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Presentation Graphic Options</value> + </prop> + </node> + <node oor:name=".uno:NavigationBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Navigation Bar Visible</value> + </prop> + </node> + <node oor:name=".uno:FormatGroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Group</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormatUngroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Ungroup</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SetDefault" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Default Formatting</value> + </prop> + </node> + <node oor:name=".uno:DecrementIndent" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Decrease Indent</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:IncrementIndent" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Increase Indent</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>7</value> + </prop> + </node> + <node oor:name=".uno:Freeline" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Freeform Line, Filled</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Freeline_Unfilled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Freeform Line</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Text_Marquee" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text Animation</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterToolbox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Filter</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterInvert" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Invert</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterSmooth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Smooth</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterSharpen" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sharpen</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterRemoveNoise" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Remove Noise</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterSobel" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Charcoal Sketch</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterMosaic" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Mosaic</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterRelief" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Relief</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterPoster" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Posterize</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterPopart" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Pop Art</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterSepia" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Aging</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GraphicFilterSolarize" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Solarization</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SpellOnline" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~AutoSpellcheck</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HideSpellMark" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Do Not Mark Errors</value> + </prop> + </node> + <node oor:name=".uno:AddressBookSource" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Address Book Source...</value> + </prop> + </node> + <node oor:name=".uno:RubyDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">As~ian phonetic guide...</value> + </prop> + </node> + <node oor:name=".uno:InsertSymbol" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">S~pecial Character...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ViewDataSourceBrowser" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Data Sources</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:MenuBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Menu On/Off</value> + </prop> + </node> + <node oor:name=".uno:MacroRecorder" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Record Macro</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:StopRecording" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Stop Recording</value> + </prop> + </node> + <node oor:name=".uno:SendMailDocAsPDF" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">E-mail as P~DF...</value> + </prop> + </node> + <node oor:name=".uno:ExportToPDF" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Export as P~DF...</value> + </prop> + </node> + <node oor:name=".uno:ConfigureDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Customize...</value> + </prop> + </node> + <node oor:name=".uno:ExportDirectToPDF" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Export Directly as PDF</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ObjectBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Object Bar</value> + </prop> + </node> + <node oor:name=".uno:ConfigureToolboxVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Customi~ze...</value> + </prop> + </node> + <node oor:name=".uno:ToolBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Main ~Toolbar</value> + </prop> + </node> + <node oor:name=".uno:FunctionBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Function Bar</value> + </prop> + </node> + <node oor:name=".uno:ShowImeStatusWindow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Input M~ethod Status</value> + </prop> + </node> + <node oor:name=".uno:OptionBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Optio~n Bar</value> + </prop> + </node> + <node oor:name=".uno:HelpSupport" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Support</value> + </prop> + </node> + <node oor:name=".uno:StatusBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Status ~Bar</value> + </prop> + </node> + <node oor:name=".uno:MacroBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Macro Toolbar On/Off</value> + </prop> + </node> + <node oor:name=".uno:CommonTaskBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Presentation</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SaveConfiguration" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Save configuration</value> + </prop> + </node> + <node oor:name=".uno:TaskBarVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value/> + </prop> + </node> + <node oor:name=".uno:LoadConfiguration" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Load Configuration</value> + </prop> + </node> + <node oor:name=".uno:LoadBasic" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Insert BASIC Source</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SaveBasicAs" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Save BASIC</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExportDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Export Dialog</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CompileBasic" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Compile</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RunBasic" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Run BASIC</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicStepInto" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Step Into</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicStepOver" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Step Over</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicStop" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Stop Macro</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:MacroDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">%PRODUCTNAME ~Basic...</value> + </prop> + </node> + <node oor:name=".uno:MacroOrganizer?TabId:short=1" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Organize ~Dialogs...</value> + </prop> + </node> + <node oor:name=".uno:ScriptOrganizer" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Organize Macros</value> + </prop> + </node> + <node oor:name=".uno:RunMacro" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">R~un Macro...</value> + </prop> + </node> + <node oor:name=".uno:Gallery" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Gallery</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SearchDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Find & Replace...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:HelperDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Help ~Agent</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:BasicStepOut" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Step Out</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Config" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Controls</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:MoreControls" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">More Controls</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormDesignTools" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Form Design</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Pushbutton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Push Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RadioButton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Option Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CheckBox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Check Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Label" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Label Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:GroupBox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Group Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Edit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ListBox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">List Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ComboBox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Combo Box</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Grid" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Table Control</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Imagebutton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Image Button</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FileControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">File Selection</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ControlProperties" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Con~trol...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormProperties" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">For~m...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:TabDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Activation Order...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FirstRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">First Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NextRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Next Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:PrevRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Previous Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:LastRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Last Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NewRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">New Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DeleteRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Delete Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AbsoluteRecord" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Absolute Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AddField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Add Field...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RecText" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Record</value> + </prop> + </node> + <node oor:name=".uno:RecFromText" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Text -> Record</value> + </prop> + </node> + <node oor:name=".uno:RecTotal" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Total No. of Records</value> + </prop> + </node> + <node oor:name=".uno:RecSave" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Save Record</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SwitchControlDesignMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Design Mode On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SwitchXFormsDesignMode" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Design Mode On/Off</value> + <value xml:lang="ar">إظهار/إخفاء وضع التصميم</value> + <value xml:lang="no">Design Mode On/Off</value> + <value xml:lang="ca">Mode de disseny activat/desactivat</value> + <value xml:lang="zh-TW">啟動或關閉設計模式</value> + <value xml:lang="cs">Režim návrhu zap/vyp</value> + <value xml:lang="da">Udkasttilstand til/fra</value> + <value xml:lang="el">Κατάσταση σχεδιασμού Ναι/Όχι</value> + <value xml:lang="es">Modo Diseño</value> + <value xml:lang="fi">Suunnittelutila käytössä / poissa käytöstä</value> + <value xml:lang="fr">(Dés)activer le mode Conception</value> + <value xml:lang="he">מצב עיצוב מופעל/מופסק</value> + <value xml:lang="it">Mostra/nascondi Modo bozza</value> + <value xml:lang="ja">デザインモード オン/オフ</value> + <value xml:lang="ko">디자인 모드 적용/적용 안함</value> + <value xml:lang="nl">Ontwerpmodus aan/uit</value> + <value xml:lang="pl">Włącz/Wyłącz tryb projektu</value> + <value xml:lang="pt-BR">Ativar/Desativar Modo Esboço</value> + <value xml:lang="ru">Визуальное проектирование формы</value> + <value xml:lang="sk">Režim návrhu zap/vyp</value> + <value xml:lang="sv">Utkastläge på/av</value> + <value xml:lang="th">โหมดออกแบบ มี/ไม่มี</value> + <value xml:lang="tr">Tasarım kipini aç/kapat</value> + <value xml:lang="hi">डिसैन प्रकार शुरू/बंद</value> + <value xml:lang="zh-CN">启动或关闭设计模式</value> + <value xml:lang="pt">Modo Esboço</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RecUndo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Undo: Data entry</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Repaint" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Redraw</value> + </prop> + </node> + <node oor:name=".uno:ShowFmExplorer" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Form Navigator...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ShowDataNavigator" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Data Navigator...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Window3D" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~3D Effects</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Quit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">E~xit</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:About" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">A~bout %PRODUCTNAME</value> + </prop> + </node> + <node oor:name=".uno:PrinterSetup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">P~rinter Settings...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SaveAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sa~ve All</value> + </prop> + </node> + <node oor:name=".uno:Context" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Current Context</value> + </prop> + </node> + <node oor:name=".uno:CurrentTime" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Current Time</value> + </prop> + </node> + <node oor:name=".uno:CurrentDate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Current Date</value> + </prop> + </node> + <node oor:name=".uno:VersionVisible" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Version Visible</value> + </prop> + </node> + <node oor:name=".uno:ShowItemBrowser" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Item Browser On/Off</value> + </prop> + </node> + <node oor:name=".uno:DateField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Date Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:TimeField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Time Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:NumericField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Numerical Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CurrencyField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Currency Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:PrintPreview" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Pa~ge Preview</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:PatternField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Pattern Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OpenReadOnly" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Open in Design Mode</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ImageControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Image Control</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RemoveFilterSort" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Remove Filter/Sort</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Sortup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sort Ascending</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SortDown" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sort Descending</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SendMail" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Document as ~E-mail...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:OrderCrit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Sort...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FilterCrit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Standard Filter...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AutoFilter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">AutoFilter</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:CountAll" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Records</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SbaNativeSql" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Run SQL command directly</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SbaExecuteSql" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Run Query</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AddTable" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Add Table...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormFiltered" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Apply Filter</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Refresh" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Refresh</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RecSearch" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Find Record...</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:UseWizards" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Wizards On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormattedField" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Formatted Field</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormFilter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Form-Based Filters</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormFilterExit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Close</value> + </prop> + </node> + <node oor:name=".uno:FormFilterExecute" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Apply Form-Based Filter</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:FormFilterNavigator" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Filter Navigation</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ConvertToEdit" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Text Box</value> + </prop> + </node> + <node oor:name=".uno:ConvertToButton" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Button</value> + </prop> + </node> + <node oor:name=".uno:ConvertToFixed" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Label Field</value> + </prop> + </node> + <node oor:name=".uno:ConvertToList" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with List Box</value> + </prop> + </node> + <node oor:name=".uno:ConvertToCheckBox" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Check Box</value> + </prop> + </node> + <node oor:name=".uno:ConvertToRadio" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Radio Button</value> + </prop> + </node> + <node oor:name=".uno:ConvertToGroup" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Group Box</value> + </prop> + </node> + <node oor:name=".uno:ConvertToCombo" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Combo Box</value> + </prop> + </node> + <node oor:name=".uno:ConvertToImageBtn" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Image Button</value> + </prop> + </node> + <node oor:name=".uno:ConvertToFileControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with File Selection</value> + </prop> + </node> + <node oor:name=".uno:ConvertToDate" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Date Field</value> + </prop> + </node> + <node oor:name=".uno:ConvertToTime" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Time Field</value> + </prop> + </node> + <node oor:name=".uno:ConvertToNumeric" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Numerical Field</value> + </prop> + </node> + <node oor:name=".uno:ConvertToCurrency" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Currency Field</value> + </prop> + </node> + <node oor:name=".uno:ConvertToPattern" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Pattern Field</value> + </prop> + </node> + <node oor:name=".uno:ConvertToImageControl" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Image Control</value> + </prop> + </node> + <node oor:name=".uno:ConvertToFormatted" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Replace with Formatted Field</value> + </prop> + </node> + <node oor:name=".uno:ViewFormAsGrid" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Data source as Table</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:RemoveFilter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Remove Filter</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:AutoControlFocus" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Automatic Control Focus</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:DSBrowserExplorer" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Explorer On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionToggle" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Extrusion On/Off</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionTiltDown" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Tilt Down</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionTiltUp" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Tilt Up</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionTiltLeft" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Tilt Left</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionTiltRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Tilt Right</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionDirectionFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Direction</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionLightingFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Lighting</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionSurfaceFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Surface</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:Extrusion3DColor" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">3D Color</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionDepth" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Extrusion</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionDepthDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Extrusion Depth</value> + </prop> + </node> + <node oor:name=".uno:ExtrusionDepthFloater" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Depth</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ShowToolbar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Toolbars</value> + </prop> + </node> + <node oor:name=".uno:AvailableToolbars" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Toolbars</value> + </prop> + </node> + <node oor:name=".uno:NavigationBar" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Navigation Bar</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:ToggleBreakPointEnabled" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Breakpoint Enabled/Disabled</value> + </prop> + </node> + <node oor:name="service:com.sun.star.deployment.ui.PackageManagerDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">~Extension Manager...</value> + </prop> + </node> + <node oor:name=".uno:Signature" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Digital Signatu~res...</value> + </prop> + </node> + <node oor:name=".uno:MacroSignature" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Digital Signature...</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignLeft" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Left</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignHorizontalCenter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Centered</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignRight" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Right</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignTop" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Top</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignVerticalCenter" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Center</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignBottom" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Bottom</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignJustified" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Justified</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignHorizontalDefault" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Default</value> + </prop> + </node> + <node oor:name=".uno:CommonAlignVerticalDefault" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Default</value> + </prop> + </node> + <node oor:name="dotuno:RecentFileList" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="x-no-translate"></value><value xml:lang="en-US">Recent Doc~uments</value> + </prop> + </node> + </node> + </node> +</oor:component-data> + +</oor:data> diff --git a/configmgr/qa/unit/makefile.mk b/configmgr/qa/unit/makefile.mk new file mode 100755 index 000000000000..78479784946f --- /dev/null +++ b/configmgr/qa/unit/makefile.mk @@ -0,0 +1,93 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +PRJ = ../.. +PRJNAME = configmgr +TARGET = unit + +ENABLE_EXCEPTIONS = TRUE + +.INCLUDE: settings.mk + +CFLAGSCXX += $(CPPUNIT_CFLAGS) + +SLOFILES = $(SLO)/test.obj + +SHL1OBJS = $(SLOFILES) +SHL1STDLIBS = \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(CPPUNITLIB) \ + $(SALLIB) + +SHL1TARGET = unit +SHL1VERSIONMAP = version.map +DEF1NAME = $(SHL1TARGET) + +.INCLUDE: target.mk + +ALLTAR: TEST + +.IF "$(OS)" == "WNT" +MY_INI = .ini +.ELSE +MY_INI = rc +.ENDIF + +$(MISC)/unit.rdb .ERRREMOVE: + cp $(SOLARBINDIR)/types.rdb $@ + $(REGCOMP) -register -r $@ -c $(DLLDEST)/$(DLLPRE)configmgr$(DLLPOST) + +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/configmgr/qa/unit/no_localization b/configmgr/qa/unit/no_localization new file mode 100755 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/configmgr/qa/unit/no_localization diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx new file mode 100644 index 000000000000..fe8d29e9ef88 --- /dev/null +++ b/configmgr/qa/unit/test.cxx @@ -0,0 +1,673 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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( + ®istry, 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; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/qa/unit/urebootstrap.ini b/configmgr/qa/unit/urebootstrap.ini new file mode 100755 index 000000000000..c413645d0f43 --- /dev/null +++ b/configmgr/qa/unit/urebootstrap.ini @@ -0,0 +1,30 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +[Bootstrap] +OOO_BASE_DIR = $ORIGIN/basis +BRAND_BASE_DIR = $ORIGIN/brand diff --git a/configmgr/qa/unit/version.map b/configmgr/qa/unit/version.map new file mode 100755 index 000000000000..6b30413b896e --- /dev/null +++ b/configmgr/qa/unit/version.map @@ -0,0 +1,34 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +UDK_3_0_0 { + global: + registerAllTestFunction; + + local: + *; +}; diff --git a/configmgr/qa/unoapi/module.sce b/configmgr/qa/unoapi/module.sce new file mode 100755 index 000000000000..d9b1c8b540b3 --- /dev/null +++ b/configmgr/qa/unoapi/module.sce @@ -0,0 +1,29 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#***********************************************************************/ + +-o configmgr.ConfigurationProvider +-o configmgr.DefaultProvider diff --git a/configmgr/source/README b/configmgr/source/README new file mode 100755 index 000000000000..f26c68ecf7c0 --- /dev/null +++ b/configmgr/source/README @@ -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. +# +#***********************************************************************/ + +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. + +parsemanager.cxx +parser.hxx +valueparser.cxx +xcdparser.cxx +xcsparser.cxx +xcuparser.cxx +xmldata.cxx + XML file reading. + +modifications.cxx +writemodfile.cxx + Modification management. + +broadcaster.cxx + Notification management. + +additions.hxx +update.cxx + Extension manager interface. + +data.cxx +lock.cxx +nodemap.cxx +partial.cxx +path.hxx +type.cxx + Utilities. + + +Mandatory Set Members +===================== + +- A set member can be marked as "mandatory," meaning that a member of that name +must always be present in a set. + +- The above definition implies that calling replaceByName on a mandatory set +member is OK. + +- The XCU format can contain oor:mandatory attributes on nodes. (The XCS format +does not support them. In the registrymodifications file, oor:mandatory +attributes should never be needed, as being mandatory cannot be controlled via +the UNO API.) The XCU reading code only evaluates the oor:mandatory attribute +for set members, and ignores it everywhere else. + +- Only true sets support mandatory members. A localized property for the "*" +locale, though acting much like a set, does not support mandatory members. + +- The OpenOffice.org Registry Format document claims that group extension +properties are implicitly mandatory, but at least the new configmgr code does +not treat them like that (i.e., they can be removed again). + +- For simplicity, setMandatory/getMandatory are available as virtual functions +at the base Node, even though they can only make sense for GroupNodes and +SetNodes that are set members. The default getMandatory implementation returns +NO_LAYER, meaning oor:mandatory is not set to true in any layer. (Returning +NO_LAYER simplifies the code, e.g., removeByName does not have to check whether +getMandatory is called on a member of a true set to decide whether to forbid +removal.) + +- When committing changes (made through the UNO API), the "mandatory" status of +inserted nodes must be updated (in case the insert is due to a replaceByName, or +the "mandatory" flag was added by a concurrent modification of a lower layer). +Also, for to-be-removed nodes, removal is ignored for (newly; due to concurrent +modification of a lower layer) mandatory nodes (but still recorded in +registrymodifications, so may take effect once the lower layer addition is +removed again---whether or not that is a good idea). + + +XcuParser Modification Recording +================================ + +- XcuParser records modifications when reading user layer data +(valueParser_.getLayer() == Data::NO_LAYER). + +- oor:finalized and oor:mandatory attributes cannot be set via the UNO API, so +it is assumed that user layer data does not contain them (for one, they are not +written by writeModFile; for another, the logic to record modifications expects +a locprop(modify,fuse) to be followed by one or more value(fuse,remove), which +would not necessarily be true if the locprop were only present in the user layer +data to flag it as finalized). + +- The logic to record modifications considers the top of the XML element stack. +In the following list of all possible cases, items marked with an asterisk are +recorded: + ... group(modify,fuse) - group(modify,fuse) - ... + ... group(modify,fuse) - set(modify,fuse) - ... + ... group(modify,fuse) - *prop(modify,fuse,replace) - value(fuse) + ... group(modify,fuse) - *prop(remove) + ... group(modify,fuse) - locprop(modify,fuse) - *value(fuse) + ... group(modify,fuse) - locprop(modify,fuse) - *value(remove) + ... group(modify,fuse) - *locprop(replace) ... + ... set(modify,fuse,replace) - group(modify/fuse) - ... + ... set(modify,fuse,replace) - *group(replace/fuse) - ... + ... set(modify,fuse,replace) - *group(remove) + ... set(modify,fuse,replace) - set(modify/fuse) - ... + ... set(modify,fuse,replace) - *set(replace/fuse) - ... + ... set(modify,fuse,replace) - *set(remove) +Legend: "...": zero or more further items + "- ...": one or more further items + "modify,fuse" etc.: any of those operations + "modify/fuse": a modify or a fuse on an existing member + "replace/fuse": a replace or a fuse on a non-existing member diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx new file mode 100644 index 000000000000..c8cb79300373 --- /dev/null +++ b/configmgr/source/access.cxx @@ -0,0 +1,2248 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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) +{ + lock_ = lock(); +} + +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 + } + 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 + } + } + // 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(); + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("org.openoffice-configmgr::Access")); +} + +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(); + // For backwards compatibility, return an absolute path representation where + // available: + rtl::OUStringBuffer path; + rtl::Reference< RootAccess > root(getRootAccess()); + if (root.is()) { + path.append(root->getAbsolutePathRepresentation()); + } + rtl::OUString rel(getRelativePathRepresentation()); + if (path.getLength() != 0 && rel.getLength() != 0) { + path.append(sal_Unicode('/')); + } + path.append(rel); + return path.makeStringAndClear(); +} + +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(true)); + 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) { + sal_Int32 i = 0; + // For backwards compatibility, allow absolute paths where meaningful: + if (path.getLength() != 0 && path[0] == '/') { + ++i; + if (!getRootAccess().is()) { + return rtl::Reference< ChildAccess >(); + } + Path abs(getAbsolutePath()); + for (Path::iterator j(abs.begin()); j != abs.end(); ++j) { + rtl::OUString name1; + bool setElement1; + rtl::OUString templateName1; + i = Data::parseSegment( + path, i, &name1, &setElement1, &templateName1); + if (i == -1 || (i != path.getLength() && path[i] != '/')) { + return rtl::Reference< ChildAccess >(); + } + rtl::OUString name2; + bool setElement2; + rtl::OUString templateName2; + Data::parseSegment(*j, 0, &name2, &setElement2, &templateName2); + if (name1 != name2 || setElement1 != setElement2 || + (setElement1 && + !Data::equalTemplateNames(templateName1, templateName2))) + { + return rtl::Reference< ChildAccess >(); + } + if (i != path.getLength()) { + ++i; + } + } + } + for (rtl::Reference< Access > parent(this);;) { + rtl::OUString name; + bool setElement; + rtl::OUString templateName; + i = Data::parseSegment(path, i, &name, &setElement, &templateName); + if (i == -1 || (i != path.getLength() && path[i] != '/')) { + return rtl::Reference< ChildAccess >(); + } + rtl::Reference< ChildAccess > child(parent->getChild(name)); + if (!child.is()) { + return rtl::Reference< ChildAccess >(); + } + if (setElement) { + rtl::Reference< Node > p(parent->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: + if (child->isValue()) { + return i == path.getLength() + ? child : rtl::Reference< ChildAccess >(); + } else if (i >= path.getLength() - 1) { + return child; + } + ++i; + parent = child.get(); + } +} + +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; + rtl::Reference< Node > parent(getParentNode()); + removable = parent.is() && parent->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 + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx new file mode 100644 index 000000000000..bf314f2f6aca --- /dev/null +++ b/configmgr/source/access.hxx @@ -0,0 +1,580 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "boost/shared_ptr.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_; + + boost::shared_ptr<osl::Mutex> lock_; + +#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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/additions.hxx b/configmgr/source/additions.hxx new file mode 100644 index 000000000000..5278dec2995f --- /dev/null +++ b/configmgr/source/additions.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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_ADDITIONS_HXX +#define INCLUDED_CONFIGMGR_SOURCE_ADDITIONS_HXX + +#include "sal/config.h" + +#include <list> + +#include "path.hxx" + +namespace configmgr { + +typedef std::list< Path > Additions; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx new file mode 100644 index 000000000000..8634dfa08bc3 --- /dev/null +++ b/configmgr/source/broadcaster.cxx @@ -0,0 +1,261 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/WrappedTargetRuntimeException.hpp" +#include "com/sun/star/lang/XEventListener.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/XInterface.hpp" +#include "com/sun/star/util/XChangesListener.hpp" +#include "cppuhelper/exc_hlp.hxx" +#include "osl/diagnose.hxx" +#include "rtl/string.h" +#include "rtl/ustrbuf.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" + +#include "broadcaster.hxx" + +namespace configmgr { + +namespace { + +namespace css = com::sun::star; + +void appendMessage( + rtl::OUStringBuffer & buffer, css::uno::Exception const & exception) +{ + buffer.appendAscii(RTL_CONSTASCII_STRINGPARAM("; ")); + buffer.append(exception.Message); +} + +} + +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() { + css::uno::Any exception; + rtl::OUStringBuffer messages; + for (DisposeNotifications::iterator i(disposeNotifications_.begin()); + i != disposeNotifications_.end(); ++i) { + try { + i->listener->disposing(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + for (ContainerNotifications::iterator i( + containerElementInsertedNotifications_.begin()); + i != containerElementInsertedNotifications_.end(); ++i) + { + try { + i->listener->elementInserted(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + for (ContainerNotifications::iterator i( + containerElementRemovedNotifications_.begin()); + i != containerElementRemovedNotifications_.end(); ++i) + { + try { + i->listener->elementRemoved(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + for (ContainerNotifications::iterator i( + containerElementReplacedNotifications_.begin()); + i != containerElementReplacedNotifications_.end(); ++i) + { + try { + i->listener->elementReplaced(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + for (PropertyChangeNotifications::iterator i( + propertyChangeNotifications_.begin()); + i != propertyChangeNotifications_.end(); ++i) + { + try { + i->listener->propertyChange(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + for (PropertiesChangeNotifications::iterator i( + propertiesChangeNotifications_.begin()); + i != propertiesChangeNotifications_.end(); ++i) + { + try { + i->listener->propertiesChange(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + for (ChangesNotifications::iterator i(changesNotifications_.begin()); + i != changesNotifications_.end(); ++i) { + try { + i->listener->changesOccurred(i->event); + } catch (css::lang::DisposedException &) { + } catch (css::uno::Exception & e) { + exception = cppu::getCaughtException(); + appendMessage(messages, e); + } + } + if (exception.hasValue()) { + throw css::lang::WrappedTargetRuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "configmgr exceptions during listener notification")) + + messages.makeStringAndClear()), + css::uno::Reference< css::uno::XInterface >(), + exception); + } +} + +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()); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/broadcaster.hxx b/configmgr/source/broadcaster.hxx new file mode 100644 index 000000000000..75db85ec015d --- /dev/null +++ b/configmgr/source/broadcaster.hxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx new file mode 100644 index 000000000000..08f22d937148 --- /dev/null +++ b/configmgr/source/childaccess.cxx @@ -0,0 +1,436 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "comphelper/servicehelper.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 "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; + +} + +namespace +{ + class theChildAccessUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theChildAccessUnoTunnelId > {}; +} + +css::uno::Sequence< sal_Int8 > ChildAccess::getTunnelId() +{ + return theChildAccessUnoTunnelId::get().getSeq(); +} + +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) +{ + lock_ = lock(); + 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) +{ + lock_ = lock(); + 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()); +} + +namespace +{ + rtl::OUString lcl_StripSegment(const rtl::OUString &rLocale) + { + sal_Int32 i = rLocale.getLength() ? rLocale.getLength() - 1 : 0; + while (i > 0 && rLocale[i] != '-' && rLocale[i] != '_') + --i; + return rLocale.copy(0, i); + } +} + +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 sLocale(getRootAccess()->getLocale()); + if (!Components::allLocales(sLocale)) + { + rtl::Reference< ChildAccess > child; + // Find best match using an adaption of RFC 4647 lookup matching + // rules, removing "-" or "_" delimited segments from the end + while (1) + { + child = getChild(sLocale); + if (child.is()) + break; + rtl::OUString sTmpLocale = lcl_StripSegment(sLocale); + if (!sTmpLocale.getLength()) + break; + sLocale = sTmpLocale; + } + + //Resolves: fdo#33638 Look for the first entry with the same + //first segment as the requested language tag, before falling + //back to en-US, etc. + typedef std::vector< rtl::Reference< ChildAccess > > ChildVector; + if (!child.is()) + { + const ChildVector &rAllChildren = getAllChildren(); + for (ChildVector::const_iterator aI = rAllChildren.begin(), + aEnd = rAllChildren.end(); aI != aEnd; ++aI) + { + rtl::OUString sLanguage = lcl_StripSegment((*aI)->getNameInternal()); + if (sLocale == sLanguage) + { + child = *aI; + break; + } + } + } + + // defaults are the "en-US" locale, the "en" locale, the empty + // string locale, the first child (if any), or a nil value (even + // though it may be illegal for the given property), in that + // order: + if (!child.is()) + { + child = getChild( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US"))); + if (!child.is()) + { + child = getChild( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en"))); + if (!child.is()) + { + child = getChild(rtl::OUString()); + if (!child.is()) + { + ChildVector 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)); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx new file mode 100644 index 000000000000..77fd5190aae8 --- /dev/null +++ b/configmgr/source/childaccess.hxx @@ -0,0 +1,156 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "boost/shared_ptr.hpp" +#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 + boost::shared_ptr<osl::Mutex> lock_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx new file mode 100644 index 000000000000..d4b3130ca9ed --- /dev/null +++ b/configmgr/source/components.cxx @@ -0,0 +1,882 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 <cstddef> +#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/conditn.hxx" +#include "osl/diagnose.h" +#include "osl/file.hxx" +#include "osl/mutex.hxx" +#include "osl/thread.hxx" +#include "rtl/bootstrap.hxx" +#include "rtl/logfile.h" +#include "rtl/ref.hxx" +#include "rtl/string.h" +#include "rtl/textenc.h" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "rtl/instance.hxx" +#include "sal/types.h" +#include "salhelper/simplereferenceobject.hxx" + +#include "additions.hxx" +#include "components.hxx" +#include "data.hxx" +#include "lock.hxx" +#include "modifications.hxx" +#include "node.hxx" +#include "nodemap.hxx" +#include "parsemanager.hxx" +#include "partial.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, Partial const * partial, + Modifications * modifications, Additions * additions) + SAL_THROW(( + css::container::NoSuchElementException, css::uno::RuntimeException)) +{ + OSL_ASSERT(partial == 0 && modifications == 0 && additions == 0); + (void) partial; (void) modifications; (void) additions; + OSL_VERIFY( + rtl::Reference< ParseManager >( + new ParseManager(url, new XcsParser(layer, data)))->parse()); +} + +void parseXcuFile( + rtl::OUString const & url, int layer, Data & data, Partial const * partial, + Modifications * modifications, Additions * additions) + SAL_THROW(( + css::container::NoSuchElementException, css::uno::RuntimeException)) +{ + OSL_VERIFY( + rtl::Reference< ParseManager >( + new ParseManager( + url, + new XcuParser( + layer, data, partial, modifications, additions)))-> + parse()); +} + +rtl::OUString expand(rtl::OUString const & str) { + rtl::OUString s(str); + rtl::Bootstrap::expandMacros(s); //TODO: detect failure + return s; +} + +bool canRemoveFromLayer(int layer, rtl::Reference< Node > const & node) { + OSL_ASSERT(node.is()); + if (node->getLayer() > layer && node->getLayer() < Data::NO_LAYER) { + return false; + } + switch (node->kind()) { + case Node::KIND_LOCALIZED_PROPERTY: + case Node::KIND_GROUP: + for (NodeMap::iterator i(node->getMembers().begin()); + i != node->getMembers().end(); ++i) + { + if (!canRemoveFromLayer(layer, i->second)) { + return false; + } + } + return true; + case Node::KIND_SET: + return node->getMembers().empty(); + default: // Node::KIND_PROPERTY, Node::KIND_LOCALIZED_VALUE + return true; + } +} + +} + +class Components::WriteThread: + public osl::Thread, public salhelper::SimpleReferenceObject +{ +public: + static void * operator new(std::size_t size) + { return Thread::operator new(size); } + + static void operator delete(void * pointer) + { Thread::operator delete(pointer); } + + WriteThread( + rtl::Reference< WriteThread > * reference, Components & components, + rtl::OUString const & url, Data const & data); + + void flush() { delay_.set(); } + +private: + virtual ~WriteThread() {} + + virtual void SAL_CALL run(); + + virtual void SAL_CALL onTerminated() { release(); } + + rtl::Reference< WriteThread > * reference_; + Components & components_; + rtl::OUString url_; + Data const & data_; + osl::Condition delay_; + boost::shared_ptr<osl::Mutex> lock_; +}; + +Components::WriteThread::WriteThread( + rtl::Reference< WriteThread > * reference, Components & components, + rtl::OUString const & url, Data const & data): + reference_(reference), components_(components), url_(url), data_(data) +{ + lock_ = lock(); + OSL_ASSERT(reference != 0); + acquire(); +} + +void Components::WriteThread::run() { + TimeValue t = { 1, 0 }; // 1 sec + delay_.wait(&t); // must not throw; result_error is harmless and ignored + osl::MutexGuard g(*lock_); // must not throw + try { + try { + writeModFile(components_, url_, data_); + } catch (css::uno::RuntimeException & e) { + // Silently ignore write errors, instead of aborting: + OSL_TRACE( + "configmgr error writing modifications: %s", + rtl::OUStringToOString( + e.Message, RTL_TEXTENCODING_UTF8).getStr()); + } + } catch (...) { + reference_->clear(); + throw; + } + reference_->clear(); +} + +class theComponentsSingleton : + public rtl::StaticWithArg< + Components, + css::uno::Reference< css::uno::XComponentContext >, + theComponentsSingleton> +{ +}; + +Components & Components::getSingleton( + css::uno::Reference< css::uno::XComponentContext > const & context) +{ + OSL_ASSERT(context.is()); + return theComponentsSingleton::get(context); +} + +bool Components::allLocales(rtl::OUString const & locale) { + return locale.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("*")); +} + +rtl::Reference< Node > Components::resolvePathRepresentation( + rtl::OUString const & pathRepresentation, + rtl::OUString * canonicRepresentation, Path * path, int * finalizedLayer) + const +{ + return data_.resolvePathRepresentation( + pathRepresentation, canonicRepresentation, 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); +} + +bool Components::hasModifications() const +{ + return data_.modifications.getRoot().children.begin() != + data_.modifications.getRoot().children.end(); +} + +void Components::writeModifications() { + + if (!hasModifications()) + return; + + if (!writeThread_.is()) { + writeThread_ = new WriteThread( + &writeThread_, *this, getModificationFileUrl(), data_); + writeThread_->create(); + } +} + +void Components::flushModifications() { + rtl::Reference< WriteThread > thread; + { + osl::MutexGuard g(*lock_); + thread = writeThread_; + } + if (thread.is()) { + thread->flush(); + thread->join(); + } +} + +void Components::insertExtensionXcsFile( + bool shared, rtl::OUString const & fileUri) +{ + try { + parseXcsFile(fileUri, shared ? 9 : 13, data_, 0, 0, 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); + int layer = shared ? 10 : 14; + Additions * adds = data_.addExtensionXcuAdditions(fileUri, layer); + try { + parseXcuFile(fileUri, layer, data_, 0, modifications, adds); + } catch (css::container::NoSuchElementException & e) { + data_.removeExtensionXcuAdditions(fileUri); + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "insertExtensionXcuFile does not exist: ")) + + e.Message), + css::uno::Reference< css::uno::XInterface >()); + } +} + +void Components::removeExtensionXcuFile( + rtl::OUString const & fileUri, Modifications * modifications) +{ + //TODO: Ideally, exactly the data coming from the specified xcu file would + // be removed. However, not enough information is recorded in the in-memory + // data structures to do so. So, as a workaround, all those set elements + // that were freshly added by the xcu and have afterwards been left + // unchanged or have only had their properties changed in the user layer are + // removed (and nothing else). The heuristic to determine + // whether a node has been left unchanged is to check the layer ID (as + // usual) and additionally to check that the node does not recursively + // contain any non-empty sets (multiple extension xcu files are merged into + // one layer, so checking layer ID alone is not enough). Since + // item->additions records all additions of set members in textual order, + // the latter check works well when iterating through item->additions in + // reverse order. + OSL_ASSERT(modifications != 0); + rtl::Reference< Data::ExtensionXcu > item( + data_.removeExtensionXcuAdditions(fileUri)); + if (item.is()) { + for (Additions::reverse_iterator i(item->additions.rbegin()); + i != item->additions.rend(); ++i) + { + rtl::Reference< Node > parent; + NodeMap const * map = &data_.components; + rtl::Reference< Node > node; + for (Path::const_iterator j(i->begin()); j != i->end(); ++j) { + parent = node; + node = Data::findNode(Data::NO_LAYER, *map, *j); + if (!node.is()) { + break; + } + map = &node->getMembers(); + } + if (node.is()) { + OSL_ASSERT(parent.is()); + if (parent->kind() == Node::KIND_SET) { + OSL_ASSERT( + node->kind() == Node::KIND_GROUP || + node->kind() == Node::KIND_SET); + if (canRemoveFromLayer(item->layer, node)) { + parent->getMembers().erase(i->back()); + data_.modifications.remove(*i); + modifications->add(*i); + } + } + } + } + writeModifications(); + } +} + +void Components::insertModificationXcuFile( + rtl::OUString const & fileUri, + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths, + Modifications * modifications) +{ + OSL_ASSERT(modifications != 0); + Partial part(includedPaths, excludedPaths); + try { + parseFileLeniently( + &parseXcuFile, fileUri, Data::NO_LAYER, data_, &part, modifications, + 0); + } catch (css::container::NoSuchElementException & e) { + OSL_TRACE( + "configmgr error inserting non-existing %s: %s", + rtl::OUStringToOString(fileUri, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); + } +} + +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; +} + +int tempHACK = 0; + +Components::Components( + css::uno::Reference< css::uno::XComponentContext > const & context): + context_(context) +{ + lock_ = lock(); + + tempHACK = 1; + + OSL_ASSERT(context.is()); + RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "begin parsing"); + 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")))); + parseXcsXcuIniLayer( + 7, + expand( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") + ":BUNDLED_EXTENSIONS_USER}/registry/" + "com.sun.star.comp.deployment.configuration." + "PackageRegistryBackend/configmgr.ini"))), + false); + parseXcsXcuIniLayer( + 9, + expand( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE("uno") + ":SHARED_EXTENSIONS_USER}/registry/" + "com.sun.star.comp.deployment.configuration." + "PackageRegistryBackend/configmgr.ini"))), + true); + parseXcsXcuLayer( + 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")))); + // can be dropped once old UserInstallation format can no longer exist + // (probably OOo 4) + 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"))), + true); + parseModificationLayer(); + RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "end parsing"); +} + +Components::~Components() +{ + flushModifications(); + tempHACK = 0; +} + +void Components::parseFileLeniently( + FileParser * parseFile, rtl::OUString const & url, int layer, Data & data, + Partial const * partial, Modifications * modifications, + Additions * additions) +{ + OSL_ASSERT(parseFile != 0); + try { + (*parseFile)(url, layer, data, partial, modifications, additions); + } catch (css::container::NoSuchElementException &) { + throw; + } catch (css::uno::Exception & e) { //TODO: more specific exception catching + // Silently ignore invalid XML files, instead of completely preventing + // OOo from starting: + OSL_TRACE( + "configmgr error reading %s: %s", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); + } +} + +void Components::parseFiles( + int layer, rtl::OUString const & extension, FileParser * parseFile, + 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( + osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName | + osl_FileStatus_Mask_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 { + parseFileLeniently( + parseFile, stat.getFileURL(), layer, data_, 0, 0, 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, FileParser * parseFile, rtl::OUString const & urls, + rtl::Bootstrap const & ini, bool recordAdditions) +{ + for (sal_Int32 i = 0;;) { + rtl::OUString url(urls.getToken(0, ' ', i)); + if (url.getLength() != 0) { + ini.expandMacrosFrom(url); //TODO: detect failure + Additions * adds = 0; + if (recordAdditions) { + adds = data_.addExtensionXcuAdditions(url, layer); + } + try { + parseFileLeniently(parseFile, url, layer, data_, 0, 0, adds); + } catch (css::container::NoSuchElementException & e) { + OSL_TRACE( + "configmgr file does not exist: %s", + rtl::OUStringToOString( + e.Message, RTL_TEXTENCODING_UTF8).getStr()); + if (adds != 0) { + data_.removeExtensionXcuAdditions(url); + } + } + } + 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( + osl_FileStatus_Mask_Type | osl_FileStatus_Mask_FileName | + osl_FileStatus_Mask_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, bool recordAdditions) +{ + //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, false); + } + if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls)) + { + parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions); + } +} + +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 { + parseFileLeniently( + &parseXcuFile, getModificationFileUrl(), Data::NO_LAYER, data_, 0, + 0, 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, probably OOo 4; also see hack for xsi namespace in + // xmlreader::XmlReader::registerNamespaceIri): + 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); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx new file mode 100644 index 000000000000..26af3fbdecea --- /dev/null +++ b/configmgr/source/components.hxx @@ -0,0 +1,186 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "boost/shared_ptr.hpp" +#include "com/sun/star/beans/Optional.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "rtl/ref.hxx" + +#include "additions.hxx" +#include "data.hxx" +#include "modifications.hxx" +#include "nodemap.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 Node; +class Partial; +class RootAccess; + +class Components: private boost::noncopyable { +public: + static Components & getSingleton( + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + const & context); + + static bool allLocales(rtl::OUString const & locale); + + rtl::Reference< Node > resolvePathRepresentation( + rtl::OUString const & pathRepresentation, + rtl::OUString * canonicRepresenation, 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(); + + bool hasModifications() const; + + void flushModifications(); + // must be called with configmgr::lock unaquired; must be called before + // shutdown if writeModifications has ever been called (probably + // indirectly, via removeExtensionXcuFile) + + void insertExtensionXcsFile(bool shared, rtl::OUString const & fileUri); + + void insertExtensionXcuFile( + bool shared, rtl::OUString const & fileUri, + Modifications * modifications); + + void removeExtensionXcuFile( + rtl::OUString const & fileUri, Modifications * modifications); + + void insertModificationXcuFile( + rtl::OUString const & fileUri, + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths, + Modifications * modifications); + + com::sun::star::beans::Optional< com::sun::star::uno::Any > + getExternalValue(rtl::OUString const & descriptor); + +private: + typedef void FileParser( + rtl::OUString const &, int, Data &, Partial const *, Modifications *, + Additions *); +public: + Components( + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + const & context); + + ~Components(); +private: + + void parseFileLeniently( + FileParser * parseFile, rtl::OUString const & url, int layer, + Data & data, Partial const * partial, Modifications * modifications, + Additions * additions); + + void parseFiles( + int layer, rtl::OUString const & extension, FileParser * parseFile, + rtl::OUString const & url, bool recursive); + + void parseFileList( + int layer, FileParser * parseFile, rtl::OUString const & urls, + rtl::Bootstrap const & ini, bool recordAdditions); + + void parseXcdFiles(int layer, rtl::OUString const & url); + + void parseXcsXcuLayer(int layer, rtl::OUString const & url); + + void parseXcsXcuIniLayer( + int layer, rtl::OUString const & url, bool recordAdditions); + + 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; + + class WriteThread; + + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + context_; + Data data_; + WeakRootSet roots_; + ExternalServices externalServices_; + rtl::Reference< WriteThread > writeThread_; + boost::shared_ptr<osl::Mutex> lock_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/configmgr.component b/configmgr/source/configmgr.component new file mode 100755 index 000000000000..6ed51257005d --- /dev/null +++ b/configmgr/source/configmgr.component @@ -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. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.configuration.ConfigurationProvider"> + <service name="com.sun.star.configuration.ConfigurationProvider"/> + </implementation> + <implementation name="com.sun.star.comp.configuration.ConfigurationRegistry"> + <service name="com.sun.star.configuration.ConfigurationRegistry"/> + </implementation> + <implementation name="com.sun.star.comp.configuration.DefaultProvider"> + <service name="com.sun.star.configuration.DefaultProvider"/> + <singleton name="com.sun.star.configuration.theDefaultProvider"/> + </implementation> + <implementation name="com.sun.star.comp.configuration.Update"> + <service name="com.sun.star.configuration.Update_Service"/> + <singleton name="com.sun.star.configuration.Update"/> + </implementation> +</component> diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx new file mode 100644 index 000000000000..6b8d967e92b9 --- /dev/null +++ b/configmgr/source/configurationprovider.cxx @@ -0,0 +1,550 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/implbase2.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) + { + lock_ = lock(); + OSL_ASSERT(context.is()); + } + +private: + virtual ~Service() {} + + virtual void SAL_CALL disposing() { flushModifications(); } + + 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(); } + + 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); + + void flushModifications() const; + + css::uno::Reference< css::uno::XComponentContext > context_; + rtl::OUString locale_; + boost::shared_ptr<osl::Mutex> lock_; +}; + +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 nodepath 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 & components = Components::getSingleton(context_); + 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) { + flushModifications(); + 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; +} + +void Service::flushModifications() const { + Components * components; + { + osl::MutexGuard guard(*lock_); + components = &Components::getSingleton(context_); + } + components->flushModifications(); +} + +class Factory: + public cppu::WeakImplHelper2< + css::lang::XSingleComponentFactory, css::lang::XServiceInfo >, + 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); + + 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(); } +}; + +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" and (ignored) + // "EnableAsync" 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 if (!name.equalsIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("enableasync"))) + { + 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; +} + +} } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/configurationprovider.hxx b/configmgr/source/configurationprovider.hxx new file mode 100644 index 000000000000..a55e99809d79 --- /dev/null +++ b/configmgr/source/configurationprovider.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx new file mode 100644 index 000000000000..a46d5ceb2e13 --- /dev/null +++ b/configmgr/source/configurationregistry.cxx @@ -0,0 +1,901 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/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/implbase1.hxx" +#include "cppuhelper/implbase3.hxx" +#include "cppuhelper/weak.hxx" +#include "osl/diagnose.h" +#include "osl/mutex.hxx" +#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; +} + +} + +css::uno::Reference< css::uno::XInterface > create( + css::uno::Reference< css::uno::XComponentContext > const & context) +{ + 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); +} + +} } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/configurationregistry.hxx b/configmgr/source/configurationregistry.hxx new file mode 100644 index 000000000000..fdba8f51e583 --- /dev/null +++ b/configmgr/source/configurationregistry.hxx @@ -0,0 +1,60 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "sal/types.h" + +namespace com { namespace sun { namespace star { + namespace uno { + class XComponentContext; + class XInterface; + } +} } } +namespace rtl { class OUString; } + +namespace configmgr { namespace configuration_registry { + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL +create( + 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(); + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx new file mode 100644 index 000000000000..989f543b197d --- /dev/null +++ b/configmgr/source/data.cxx @@ -0,0 +1,375 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/textenc.h" +#include "rtl/ustrbuf.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "additions.hxx" +#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("&")); + break; + case '"': + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(""")); + break; + case '\'': + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("'")); + 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, + rtl::OUString * canonicRepresentation, 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; + rtl::OUString templateName; + 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)); + rtl::OUStringBuffer canonic; + 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 (canonicRepresentation != 0) { + canonic.append(sal_Unicode('/')); + canonic.append(createSegment(templateName, seg)); + } + 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 (canonicRepresentation != 0) { + *canonicRepresentation = canonic.makeStringAndClear(); + } + if (finalizedLayer != 0) { + *finalizedLayer = finalized; + } + return p; + } + parent = p; + templateName = rtl::OUString(); + 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); +} + +Additions * Data::addExtensionXcuAdditions( + rtl::OUString const & url, int layer) +{ + rtl::Reference< ExtensionXcu > item(new ExtensionXcu); + ExtensionXcuAdditions::iterator i( + extensionXcuAdditions_.insert( + ExtensionXcuAdditions::value_type( + url, rtl::Reference< ExtensionXcu >())).first); + if (i->second.is()) { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "already added extension xcu ")) + + url), + css::uno::Reference< css::uno::XInterface >()); + } + i->second = item; + item->layer = layer; + return &item->additions; +} + +rtl::Reference< Data::ExtensionXcu > Data::removeExtensionXcuAdditions( + rtl::OUString const & url) +{ + ExtensionXcuAdditions::iterator i(extensionXcuAdditions_.find(url)); + if (i == extensionXcuAdditions_.end()) { + // This can happen, as migration of pre OOo 3.3 UserInstallation + // extensions in dp_registry::backend::configuration::BackendImpl:: + // PackageImpl::processPackage_ can cause just-in-time creation of + // extension xcu files that are never added via addExtensionXcuAdditions + // (also, there might be url spelling differences between calls to + // addExtensionXcuAdditions and removeExtensionXcuAdditions?): + OSL_TRACE( + "unknown configmgr::Data::removeExtensionXcuAdditions(%s)", + rtl::OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr()); + return rtl::Reference< ExtensionXcu >(); + } + rtl::Reference< ExtensionXcu > item(i->second); + extensionXcuAdditions_.erase(i); + return item; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx new file mode 100644 index 000000000000..f60ecfa1e807 --- /dev/null +++ b/configmgr/source/data.hxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 <map> +#include <vector> + +#include "boost/noncopyable.hpp" +#include "rtl/ref.hxx" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "salhelper/simplereferenceobject.hxx" + +#include "additions.hxx" +#include "modifications.hxx" +#include "nodemap.hxx" +#include "path.hxx" + +namespace configmgr { + +class Node; + +struct Data: private boost::noncopyable { + enum { NO_LAYER = INT_MAX }; + + struct ExtensionXcu: public salhelper::SimpleReferenceObject { + int layer; + Additions additions; + }; + + 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, + rtl::OUString * canonicRepresenation, Path * path, int * finalizedLayer) + const; + + rtl::Reference< Node > getTemplate( + int layer, rtl::OUString const & fullName) const; + + Additions * addExtensionXcuAdditions( + rtl::OUString const & url, int layer); + + rtl::Reference< ExtensionXcu > removeExtensionXcuAdditions( + rtl::OUString const & url); + +private: + typedef std::map< rtl::OUString, rtl::Reference< ExtensionXcu > > + ExtensionXcuAdditions; + + ExtensionXcuAdditions extensionXcuAdditions_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx new file mode 100644 index 000000000000..c938e2b31951 --- /dev/null +++ b/configmgr/source/defaultprovider.cxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/Sequence.hxx" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "com/sun/star/uno/XInterface.hpp" +#include "osl/mutex.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" + +#include "configurationprovider.hxx" +#include "defaultprovider.hxx" +#include "lock.hxx" + +namespace configmgr { namespace default_provider { + +namespace css = com::sun::star; + +css::uno::Reference< css::uno::XInterface > create( + css::uno::Reference< css::uno::XComponentContext > const & context) +{ + 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); +} + +} } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/defaultprovider.hxx b/configmgr/source/defaultprovider.hxx new file mode 100644 index 000000000000..1dbc44d525e0 --- /dev/null +++ b/configmgr/source/defaultprovider.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "sal/types.h" + +namespace com { namespace sun { namespace star { + namespace uno { + class XComponentContext; + class XInterface; + } +} } } +namespace rtl { class OUString; } + +namespace configmgr { namespace default_provider { + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL +create( + 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(); + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/groupnode.cxx b/configmgr/source/groupnode.cxx new file mode 100644 index 000000000000..fa56afa1a29c --- /dev/null +++ b/configmgr/source/groupnode.cxx @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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(bool keepTemplateName) const { + return new GroupNode(*this, keepTemplateName); +} + +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, bool keepTemplateName): + Node(other), extensible_(other.extensible_), mandatory_(other.mandatory_) +{ + cloneNodeMap(other.members_, &members_); + if (keepTemplateName) { + templateName_ = other.templateName_; + } +} + +GroupNode::~GroupNode() {} + +Node::Kind GroupNode::kind() const { + return KIND_GROUP; +} + +void GroupNode::clear() { + members_.clear(); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/groupnode.hxx b/configmgr/source/groupnode.hxx new file mode 100644 index 000000000000..02f1679998a2 --- /dev/null +++ b/configmgr/source/groupnode.hxx @@ -0,0 +1,78 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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(bool keepTemplateName) 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, bool keepTemplateName); + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/localizedpropertynode.cxx b/configmgr/source/localizedpropertynode.cxx new file mode 100644 index 000000000000..c03f552de1d3 --- /dev/null +++ b/configmgr/source/localizedpropertynode.cxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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(bool) 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(); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/localizedpropertynode.hxx b/configmgr/source/localizedpropertynode.hxx new file mode 100644 index 000000000000..bbe934e36bcd --- /dev/null +++ b/configmgr/source/localizedpropertynode.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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(bool keepTemplateName) 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/localizedvaluenode.cxx b/configmgr/source/localizedvaluenode.cxx new file mode 100644 index 000000000000..ac6346f09227 --- /dev/null +++ b/configmgr/source/localizedvaluenode.cxx @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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(bool) 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; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/localizedvaluenode.hxx b/configmgr/source/localizedvaluenode.hxx new file mode 100644 index 000000000000..23139bec4029 --- /dev/null +++ b/configmgr/source/localizedvaluenode.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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(bool keepTemplateName) 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx new file mode 100644 index 000000000000..3950a2d5e3e0 --- /dev/null +++ b/configmgr/source/lock.cxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 { + +boost::shared_ptr<osl::Mutex> lock() +{ + static boost::shared_ptr<osl::Mutex> theLock; + if (!theLock.get()) + theLock.reset(new osl::Mutex); + return theLock; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/lock.hxx b/configmgr/source/lock.hxx new file mode 100644 index 000000000000..b37e83a44ee2 --- /dev/null +++ b/configmgr/source/lock.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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" +#include "boost/shared_ptr.hpp" + +namespace configmgr { + +boost::shared_ptr<osl::Mutex> lock(); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/makefile.mk b/configmgr/source/makefile.mk new file mode 100755 index 000000000000..94747d9dd803 --- /dev/null +++ b/configmgr/source/makefile.mk @@ -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. +# +#***********************************************************************/ + +PRJ = .. +PRJNAME = configmgr +TARGET = configmgr + +ENABLE_EXCEPTIONS = TRUE +VISIBILITY_HIDDEN = TRUE + +.INCLUDE: settings.mk + +DLLPRE = + +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)/parsemanager.obj \ + $(SLO)/partial.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 + +SHL1IMPLIB = i$(SHL1TARGET) +SHL1OBJS = $(SLOFILES) +SHL1STDLIBS = \ + $(COMPHELPERLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALHELPERLIB) \ + $(SALLIB) \ + $(XMLREADERLIB) +SHL1TARGET = configmgr.uno +SHL1USE_EXPORTS = name +DEF1NAME = $(SHL1TARGET) + +.INCLUDE: target.mk + +ALLTAR : $(MISC)/configmgr.component + +$(MISC)/configmgr.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + configmgr.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt configmgr.component diff --git a/configmgr/source/modifications.cxx b/configmgr/source/modifications.cxx new file mode 100644 index 000000000000..e83d4a501af6 --- /dev/null +++ b/configmgr/source/modifications.cxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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(); +} + +void Modifications::remove(Path const & path) { + OSL_ASSERT(!path.empty()); + Node * p = &root_; + for (Path::const_iterator i(path.begin());;) { + Node::Children::iterator j(p->children.find(*i)); + if (j == p->children.end()) { + break; + } + if (++i == path.end()) { + p->children.erase(j); + if (p->children.empty()) { + Path parent(path); + parent.pop_back(); + remove(parent); + } + break; + } + p = &j->second; + } +} + +Modifications::Node const & Modifications::getRoot() const { + return root_; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/modifications.hxx b/configmgr/source/modifications.hxx new file mode 100644 index 000000000000..fa4f08a157fd --- /dev/null +++ b/configmgr/source/modifications.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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); + + void remove(Path const & path); + + Node const & getRoot() const; + +private: + Node root_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/node.cxx b/configmgr/source/node.cxx new file mode 100644 index 000000000000..58d13c4fee55 --- /dev/null +++ b/configmgr/source/node.cxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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() {} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/node.hxx b/configmgr/source/node.hxx new file mode 100644 index 000000000000..932d11cf3744 --- /dev/null +++ b/configmgr/source/node.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "salhelper/simplereferenceobject.hxx" + +#include "nodemap.hxx" + +namespace rtl { class OUString; } + +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(bool keepTemplateName) 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(); + + int layer_; + int finalized_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/nodemap.cxx b/configmgr/source/nodemap.cxx new file mode 100644 index 000000000000..432aa64e7991 --- /dev/null +++ b/configmgr/source/nodemap.cxx @@ -0,0 +1,53 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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(true); + } + std::swap(clone, *target); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/nodemap.hxx b/configmgr/source/nodemap.hxx new file mode 100644 index 000000000000..5e9e501e9fc7 --- /dev/null +++ b/configmgr/source/nodemap.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/parsemanager.cxx b/configmgr/source/parsemanager.cxx new file mode 100644 index 000000000000..c62df8eeba17 --- /dev/null +++ b/configmgr/source/parsemanager.cxx @@ -0,0 +1,104 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" + +#include "parsemanager.hxx" +#include "parser.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()); + int id; + id = reader_.registerNamespaceIri( + xmlreader::Span( + RTL_CONSTASCII_STRINGPARAM("http://openoffice.org/2001/registry"))); + OSL_ASSERT(id == NAMESPACE_OOR); + id = reader_.registerNamespaceIri( + xmlreader::Span( + RTL_CONSTASCII_STRINGPARAM("http://www.w3.org/2001/XMLSchema"))); + OSL_ASSERT(id == NAMESPACE_XS); + id = reader_.registerNamespaceIri( + xmlreader::Span( + RTL_CONSTASCII_STRINGPARAM( + "http://www.w3.org/2001/XMLSchema-instance"))); + OSL_ASSERT(id == NAMESPACE_XSI); + (void)id; +} + +bool ParseManager::parse() { + for (;;) { + switch (itemData_.is() + ? xmlreader::XmlReader::RESULT_BEGIN + : reader_.nextItem( + parser_->getTextMode(), &itemData_, &itemNamespaceId_)) + { + case xmlreader::XmlReader::RESULT_BEGIN: + if (!parser_->startElement(reader_, itemNamespaceId_, itemData_)) + { + return false; + } + break; + case xmlreader::XmlReader::RESULT_END: + parser_->endElement(reader_); + break; + case xmlreader::XmlReader::RESULT_TEXT: + parser_->characters(itemData_); + break; + case xmlreader::XmlReader::RESULT_DONE: + return true; + } + itemData_.clear(); + } +} + +ParseManager::~ParseManager() {} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/parsemanager.hxx b/configmgr/source/parsemanager.hxx new file mode 100644 index 000000000000..a6a238b0a0ec --- /dev/null +++ b/configmgr/source/parsemanager.hxx @@ -0,0 +1,73 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "xmlreader/span.hxx" +#include "xmlreader/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(); + + enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 }; + +private: + virtual ~ParseManager(); + + xmlreader::XmlReader reader_; + rtl::Reference< Parser > parser_; + xmlreader::Span itemData_; + int itemNamespaceId_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/parser.hxx b/configmgr/source/parser.hxx new file mode 100644 index 000000000000..a7151b71c616 --- /dev/null +++ b/configmgr/source/parser.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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/xmlreader.hxx" + +namespace xmlreader { struct Span; } + +namespace configmgr { + +class Parser: public salhelper::SimpleReferenceObject { +public: + virtual xmlreader::XmlReader::Text getTextMode() = 0; + + virtual bool startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) + = 0; + + virtual void endElement(xmlreader::XmlReader const & reader) = 0; + + virtual void characters(xmlreader::Span const & text) = 0; + +protected: + Parser() {} + + virtual ~Parser() {} +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/partial.cxx b/configmgr/source/partial.cxx new file mode 100644 index 000000000000..f3f91a4c05a6 --- /dev/null +++ b/configmgr/source/partial.cxx @@ -0,0 +1,140 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 <map> +#include <set> + +#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/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "data.hxx" +#include "partial.hxx" + +namespace configmgr { + +namespace { + +namespace css = com::sun::star; + +bool parseSegment( + rtl::OUString const & path, sal_Int32 * index, rtl::OUString * segment) +{ + OSL_ASSERT( + index != 0 && *index >= 0 && *index <= path.getLength() && + segment != 0); + if (path[(*index)++] == '/') { + rtl::OUString name; + bool setElement; + rtl::OUString templateName; + *index = Data::parseSegment( + path, *index, &name, &setElement, &templateName); + if (*index != -1) { + *segment = Data::createSegment(templateName, name); + return *index == path.getLength(); + } + } + throw css::uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad path ")) + path, + css::uno::Reference< css::uno::XInterface >()); +} + +} + +Partial::Partial( + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths) +{ + for (std::set< rtl::OUString >::const_iterator i(includedPaths.begin()); + i != includedPaths.end(); ++i) + { + sal_Int32 n = 0; + for (Node * p = &root_;;) { + rtl::OUString seg; + bool end = parseSegment(*i, &n, &seg); + p = &p->children[seg]; + if (p->startInclude) { + break; + } + if (end) { + p->children.clear(); + p->startInclude = true; + break; + } + } + } + for (std::set< rtl::OUString >::const_iterator i(excludedPaths.begin()); + i != excludedPaths.end(); ++i) + { + sal_Int32 n = 0; + for (Node * p = &root_;;) { + rtl::OUString seg; + bool end = parseSegment(*i, &n, &seg); + if (end) { + p->children[seg] = Node(); + break; + } + Node::Children::iterator j(p->children.find(seg)); + if (j == p->children.end()) { + break; + } + p = &j->second; + } + } +} + +Partial::~Partial() {} + +Partial::Containment Partial::contains(Path const & path) const { + //TODO: For set elements, the segment names recorded in the node tree need + // not match the corresponding path segments, so this function can fail. + Node const * p = &root_; + bool includes = false; + for (Path::const_iterator i(path.begin()); i != path.end(); ++i) { + Node::Children::const_iterator j(p->children.find(*i)); + if (j == p->children.end()) { + break; + } + p = &j->second; + includes |= p->startInclude; + } + return p->children.empty() && !p->startInclude + ? CONTAINS_NOT + : includes ? CONTAINS_NODE : CONTAINS_SUBNODES; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/partial.hxx b/configmgr/source/partial.hxx new file mode 100644 index 000000000000..135aa5d66355 --- /dev/null +++ b/configmgr/source/partial.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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_PARTIAL_HXX +#define INCLUDED_CONFIGMGR_SOURCE_PARTIAL_HXX + +#include "sal/config.h" + +#include <map> +#include <set> + +#include "boost/noncopyable.hpp" + +#include "path.hxx" + +namespace rtl { class OUString; } + +namespace configmgr { + +class Partial: private boost::noncopyable { +public: + enum Containment { CONTAINS_NOT, CONTAINS_SUBNODES, CONTAINS_NODE }; + + Partial( + std::set< rtl::OUString > const & includedPaths, + std::set< rtl::OUString > const & excludedPaths); + + ~Partial(); + + Containment contains(Path const & path) const; + +private: + struct Node { + typedef std::map< rtl::OUString, Node > Children; + + Node(): startInclude(false) {} + + Children children; + bool startInclude; + }; + + Node root_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/path.hxx b/configmgr/source/path.hxx new file mode 100644 index 000000000000..2de401099d00 --- /dev/null +++ b/configmgr/source/path.hxx @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/propertynode.cxx b/configmgr/source/propertynode.cxx new file mode 100644 index 000000000000..8e2eec660d2b --- /dev/null +++ b/configmgr/source/propertynode.cxx @@ -0,0 +1,113 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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), + extension_(extension), value_(value) +{} + +rtl::Reference< Node > PropertyNode::clone(bool) 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_), + extension_(other.extension_), externalDescriptor_(other.externalDescriptor_), + value_(other.value_) +{} + +PropertyNode::~PropertyNode() {} + +Node::Kind PropertyNode::kind() const { + return KIND_PROPERTY; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/propertynode.hxx b/configmgr/source/propertynode.hxx new file mode 100644 index 000000000000..6e0edc895f29 --- /dev/null +++ b/configmgr/source/propertynode.hxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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(bool keepTemplateName) 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_; + bool extension_; + rtl::OUString externalDescriptor_; + com::sun::star::uno::Any value_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx new file mode 100644 index 000000000000..f320b999dcd2 --- /dev/null +++ b/configmgr/source/rootaccess.cxx @@ -0,0 +1,350 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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) +{ + lock_ = lock(); +} + +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) + { + cppu::OWeakObject* pSource = static_cast< cppu::OWeakObject * >(this); + css::uno::Reference< css::uno::XInterface > xBase( pSource, css::uno::UNO_QUERY ); + broadcaster->addChangesNotification( + *i, + css::util::ChangesEvent( + pSource, makeAny( xBase ), set)); + } + } +} + +void RootAccess::acquire() throw () { + Access::acquire(); +} + +void RootAccess::release() throw () { + Access::release(); +} + +rtl::OUString RootAccess::getAbsolutePathRepresentation() { + getNode(); // turn pathRepresentation_ into canonic form + return pathRepresentation_; +} + +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()) { + rtl::OUString canonic; + int finalizedLayer; + node_ = getComponents().resolvePathRepresentation( + pathRepresentation_, &canonic, &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 + } + pathRepresentation_ = canonic; + 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); + } +} + +extern int tempHACK; + +void RootAccess::commitChanges() + throw (css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + OSL_ASSERT(thisIs(IS_UPDATE)); + Broadcaster bc; + { + osl::MutexGuard g(*lock_); + + // OSL_ENSURE(tempHACK, "fucktastic!, seriously busted lifecycles\n"); + if (!tempHACK) + { + return; + } + + checkLocalizedPropertyAccess(); + int finalizedLayer; + Modifications globalMods; + commitChildChanges( + ((getComponents().resolvePathRepresentation( + pathRepresentation_, 0, 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(); +} + +rtl::OUString RootAccess::getImplementationName() throw (css::uno::RuntimeException) +{ + OSL_ASSERT(thisIs(IS_ANY)); + osl::MutexGuard g(*lock_); + checkLocalizedPropertyAccess(); + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "configmgr.RootAccess" ) ); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx new file mode 100644 index 000000000000..c1751210c50c --- /dev/null +++ b/configmgr/source/rootaccess.hxx @@ -0,0 +1,168 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "boost/shared_ptr.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 getAbsolutePathRepresentation(); + + rtl::OUString getLocale() const; + + bool isUpdate() const; + +protected: + + virtual rtl::OUString SAL_CALL getImplementationName() + throw (com::sun::star::uno::RuntimeException); + +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_; + + boost::shared_ptr<osl::Mutex> lock_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx new file mode 100644 index 000000000000..5f70c6ed708a --- /dev/null +++ b/configmgr/source/services.cxx @@ -0,0 +1,86 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/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/factory.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "osl/diagnose.h" +#include "uno/lbnames.h" +#include "sal/types.h" + +#include "configurationprovider.hxx" +#include "configurationregistry.hxx" +#include "defaultprovider.hxx" +#include "update.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 }, + { &configmgr::default_provider::create, + &configmgr::default_provider::getImplementationName, + &configmgr::default_provider::getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { &configmgr::configuration_registry::create, + &configmgr::configuration_registry::getImplementationName, + &configmgr::configuration_registry::getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { &configmgr::update::create, &configmgr::update::getImplementationName, + &configmgr::update::getSupportedServiceNames, + &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); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/setnode.cxx b/configmgr/source/setnode.cxx new file mode 100644 index 000000000000..52b117bb0154 --- /dev/null +++ b/configmgr/source/setnode.cxx @@ -0,0 +1,132 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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(bool keepTemplateName) const { + return new SetNode(*this, keepTemplateName); +} + +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, bool keepTemplateName): + Node(other), defaultTemplateName_(other.defaultTemplateName_), + additionalTemplateNames_(other.additionalTemplateNames_), + mandatory_(other.mandatory_) +{ + cloneNodeMap(other.members_, &members_); + if (keepTemplateName) { + templateName_ = other.templateName_; + } +} + +SetNode::~SetNode() {} + +Node::Kind SetNode::kind() const { + return KIND_SET; +} + +void SetNode::clear() { + members_.clear(); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/setnode.hxx b/configmgr/source/setnode.hxx new file mode 100644 index 000000000000..00bcab2a55a1 --- /dev/null +++ b/configmgr/source/setnode.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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(bool keepTemplateName) 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, bool keepTemplateName); + + 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/type.cxx b/configmgr/source/type.cxx new file mode 100644 index 000000000000..b3bfd72d3e8d --- /dev/null +++ b/configmgr/source/type.cxx @@ -0,0 +1,190 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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; + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/type.hxx b/configmgr/source/type.hxx new file mode 100644 index 000000000000..91e335de1e44 --- /dev/null +++ b/configmgr/source/type.hxx @@ -0,0 +1,59 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx new file mode 100644 index 000000000000..d63ff05841ab --- /dev/null +++ b/configmgr/source/update.cxx @@ -0,0 +1,187 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 <set> + +#include "boost/noncopyable.hpp" +#include "boost/shared_ptr.hpp" +#include "com/sun/star/configuration/XUpdate.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/implbase1.hxx" +#include "cppuhelper/weak.hxx" +#include "osl/mutex.hxx" +#include "rtl/ref.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "broadcaster.hxx" +#include "components.hxx" +#include "lock.hxx" +#include "modifications.hxx" +#include "rootaccess.hxx" +#include "update.hxx" + +namespace configmgr { namespace update { + +namespace { + +namespace css = com::sun::star; + +std::set< rtl::OUString > seqToSet( + css::uno::Sequence< rtl::OUString > const & sequence) +{ + return std::set< rtl::OUString >( + sequence.getConstArray(), + sequence.getConstArray() + sequence.getLength()); +} + +class Service: + public cppu::WeakImplHelper1< css::configuration::XUpdate >, + private boost::noncopyable +{ +public: + Service(css::uno::Reference< css::uno::XComponentContext > const context): + context_(context) + { + OSL_ASSERT(context.is()); + lock_ = lock(); + } + +private: + virtual ~Service() {} + + virtual void SAL_CALL insertExtensionXcsFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL insertExtensionXcuFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL removeExtensionXcuFile(rtl::OUString const & fileUri) + throw (css::uno::RuntimeException); + + virtual void SAL_CALL insertModificationXcuFile( + rtl::OUString const & fileUri, + css::uno::Sequence< rtl::OUString > const & includedPaths, + css::uno::Sequence< rtl::OUString > const & excludedPaths) + throw (css::uno::RuntimeException); + + boost::shared_ptr<osl::Mutex> lock_; + css::uno::Reference< css::uno::XComponentContext > context_; +}; + +void Service::insertExtensionXcsFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ + osl::MutexGuard g(*lock_); + Components::getSingleton(context_).insertExtensionXcsFile(shared, fileUri); +} + +void Service::insertExtensionXcuFile( + sal_Bool shared, rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ + Broadcaster bc; + { + osl::MutexGuard g(*lock_); + Components & components = Components::getSingleton(context_); + Modifications mods; + components.insertExtensionXcuFile(shared, fileUri, &mods); + components.initGlobalBroadcaster( + mods, rtl::Reference< RootAccess >(), &bc); + } + bc.send(); +} + +void Service::removeExtensionXcuFile(rtl::OUString const & fileUri) + throw (css::uno::RuntimeException) +{ + Broadcaster bc; + { + osl::MutexGuard g(*lock_); + Components & components = Components::getSingleton(context_); + Modifications mods; + components.removeExtensionXcuFile(fileUri, &mods); + components.initGlobalBroadcaster( + mods, rtl::Reference< RootAccess >(), &bc); + } + bc.send(); +} + +void Service::insertModificationXcuFile( + rtl::OUString const & fileUri, + css::uno::Sequence< rtl::OUString > const & includedPaths, + css::uno::Sequence< rtl::OUString > const & excludedPaths) + throw (css::uno::RuntimeException) +{ + Broadcaster bc; + { + osl::MutexGuard g(*lock_); + Components & components = Components::getSingleton(context_); + Modifications mods; + components.insertModificationXcuFile( + fileUri, seqToSet(includedPaths), seqToSet(excludedPaths), &mods); + components.initGlobalBroadcaster( + mods, rtl::Reference< RootAccess >(), &bc); + } + bc.send(); +} + +} + +css::uno::Reference< css::uno::XInterface > create( + css::uno::Reference< css::uno::XComponentContext > const & context) +{ + return static_cast< cppu::OWeakObject * >(new Service(context)); +} + +rtl::OUString getImplementationName() { + return rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.Update")); +} + +css::uno::Sequence< rtl::OUString > getSupportedServiceNames() { + rtl::OUString name( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.Update_Service")); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} + +} } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/update.hxx b/configmgr/source/update.hxx new file mode 100644 index 000000000000..3e423679d327 --- /dev/null +++ b/configmgr/source/update.hxx @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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_UPDATE_HXX +#define INCLUDED_CONFIGMGR_SOURCE_UPDATE_HXX + +#include "sal/config.h" + +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/Sequence.hxx" +#include "sal/types.h" + +namespace com { namespace sun { namespace star { + namespace uno { + class XComponentContext; + class XInterface; + } +} } } +namespace rtl { class OUString; } + +namespace configmgr { namespace update { + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL +create( + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + const &); + +rtl::OUString SAL_CALL getImplementationName(); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL +getSupportedServiceNames(); + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx new file mode 100644 index 000000000000..8488531019cb --- /dev/null +++ b/configmgr/source/valueparser.cxx @@ -0,0 +1,481 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" + +#include "localizedvaluenode.hxx" +#include "node.hxx" +#include "nodemap.hxx" +#include "parsemanager.hxx" +#include "propertynode.hxx" +#include "type.hxx" +#include "valueparser.hxx" +#include "xmldata.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(xmlreader::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(xmlreader::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(xmlreader::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(xmlreader::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(xmlreader::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(xmlreader::Span const & text, rtl::OUString * value) { + OSL_ASSERT(text.is() && value != 0); + *value = text.convertFromUtf8(); + return true; +} + +bool parseValue( + xmlreader::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( + xmlreader::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, xmlreader::Span const & text) +{ + comphelper::SequenceAsVector< T > seq; + xmlreader::Span sep; + if (separator.getLength() == 0) { + sep = xmlreader::Span(RTL_CONSTASCII_STRINGPARAM(" ")); + } else { + sep = xmlreader::Span(separator.getStr(), separator.getLength()); + } + if (text.length != 0) { + for (xmlreader::Span t(text);;) { + sal_Int32 i = rtl_str_indexOfStr_WithLength( + t.begin, t.length, sep.begin, sep.length); + T val; + if (!parseValue( + xmlreader::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, xmlreader::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::XmlReader::Text ValueParser::getTextMode() const { + if (node_.is()) { + switch (state_) { + case STATE_TEXT: + if (!items_.empty()) { + break; + } + // fall through + case STATE_IT: + return + (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST || + separator_.getLength() != 0) + ? xmlreader::XmlReader::TEXT_RAW + : xmlreader::XmlReader::TEXT_NORMALIZED; + default: + break; + } + } + return xmlreader::XmlReader::TEXT_NONE; +} + +bool ValueParser::startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) +{ + if (!node_.is()) { + return false; + } + switch (state_) { + case STATE_TEXT: + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("it")) && + isListType(type_) && separator_.getLength() == 0) + { + pad_.clear(); + // before first <it>, characters are not ignored; assume they + // are only whitespace + state_ = STATE_IT; + return true; + } + // fall through + case STATE_IT: + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("unicode")) && + (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST)) + { + sal_Int32 scalar = -1; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::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 <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); +} + +bool ValueParser::endElement() { + 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 { + 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(xmlreader::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_; +} + +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); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/valueparser.hxx b/configmgr/source/valueparser.hxx new file mode 100644 index 000000000000..a3ee2310ea35 --- /dev/null +++ b/configmgr/source/valueparser.hxx @@ -0,0 +1,95 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "xmlreader/pad.hxx" +#include "xmlreader/xmlreader.hxx" + +#include "type.hxx" + +namespace com { namespace sun { namespace star { namespace uno { + class Any; +} } } } +namespace xmlreader { struct Span; } + +namespace configmgr { + +class Node; + +class ValueParser: private boost::noncopyable { +public: + ValueParser(int layer); + + ~ValueParser(); + + xmlreader::XmlReader::Text getTextMode() const; + + bool startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); + + bool endElement(); + + void characters(xmlreader::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: + 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_; + xmlreader::Pad pad_; + std::vector< com::sun::star::uno::Any > items_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx new file mode 100644 index 000000000000..fcb1129bba1e --- /dev/null +++ b/configmgr/source/writemodfile.cxx @@ -0,0 +1,605 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "xmlreader/span.hxx" + +#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 "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("	")); + i = j + 1; + break; + case '\x0A': + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("
")); + i = j + 1; + break; + case '\x0D': + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("
")); + i = j + 1; + break; + case '"': + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM(""")); + i = j + 1; + break; + case '&': + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("&")); + i = j + 1; + break; + case '<': + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("<")); + 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("
")); + i = j + 1; + } else if (c == '&') { + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("&")); + i = j + 1; + } else if (c == '<') { + writeData(handle, convertToUtf8(value, i, j - i)); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("<")); + 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(">")); + 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 xmlreader::Span const typeNames[] = { + xmlreader::Span(), xmlreader::Span(), xmlreader::Span(), + // TYPE_ERROR, TYPE_NIL, TYPE_ANY + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:boolean")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:short")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:int")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:long")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:double")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:string")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("xs:hexBinary")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:boolean-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:short-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:int-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:long-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:double-list")), + xmlreader::Span(RTL_CONSTASCII_STRINGPARAM("oor:string-list")), + xmlreader::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 & parentPathRepresentation, + 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 + writeData(handle, RTL_CONSTASCII_STRINGPARAM("<item oor:path=\"")); + writeAttributeValue(handle, parentPathRepresentation); + writeData(handle, RTL_CONSTASCII_STRINGPARAM("\">")); + if (node.is()) { + writeNode(components, handle, parent, nodeName, node); + } else { + switch (parent->kind()) { + case Node::KIND_LOCALIZED_PROPERTY: + writeData(handle, RTL_CONSTASCII_STRINGPARAM("<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\"/>")); + break; + case Node::KIND_GROUP: + OSL_ASSERT( + dynamic_cast< GroupNode * >(parent.get())->isExtensible()); + writeData( + handle, RTL_CONSTASCII_STRINGPARAM("<prop oor:name=\"")); + writeAttributeValue(handle, nodeName); + writeData( + handle, + RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"remove\"/>")); + break; + case Node::KIND_SET: + writeData( + handle, RTL_CONSTASCII_STRINGPARAM("<node oor:name=\"")); + writeAttributeValue(handle, nodeName); + writeData( + handle, + RTL_CONSTASCII_STRINGPARAM("\" oor:op=\"remove\"/>")); + break; + default: + OSL_ASSERT(false); // this cannot happen + break; + } + } + writeData(handle, RTL_CONSTASCII_STRINGPARAM("</item>")); + } else { + OSL_ASSERT(node.is()); + rtl::OUString pathRep( + parentPathRepresentation + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + + Data::createSegment(node->getTemplateName(), nodeName)); + for (Modifications::Node::Children::const_iterator i( + modifications.children.begin()); + i != modifications.children.end(); ++i) + { + writeModifications( + components, handle, pathRep, 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::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; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/writemodfile.hxx b/configmgr/source/writemodfile.hxx new file mode 100644 index 000000000000..0277bacdc477 --- /dev/null +++ b/configmgr/source/writemodfile.hxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx new file mode 100644 index 000000000000..7c2e21d6c6bb --- /dev/null +++ b/configmgr/source/xcdparser.cxx @@ -0,0 +1,188 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" + +#include "parsemanager.hxx" +#include "xcdparser.hxx" +#include "xcsparser.hxx" +#include "xcuparser.hxx" +#include "xmldata.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::XmlReader::Text XcdParser::getTextMode() { + return nestedParser_.is() + ? nestedParser_->getTextMode() : xmlreader::XmlReader::TEXT_NONE; +} + +bool XcdParser::startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) +{ + if (nestedParser_.is()) { + OSL_ASSERT(nesting_ != LONG_MAX); + ++nesting_; + return nestedParser_->startElement(reader, nsId, name); + } + switch (state_) { + case STATE_START: + if (nsId == ParseManager::NAMESPACE_OOR && + name.equals(RTL_CONSTASCII_STRINGPARAM("data"))) + { + state_ = STATE_DEPENDENCIES; + return true; + } + break; + case STATE_DEPENDENCIES: + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("dependency"))) + { + if (dependency_.getLength() == 0) { + xmlreader::Span attrFile; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == xmlreader::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_ = attrFile.convertFromUtf8(); + 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 (nsId == ParseManager::NAMESPACE_OOR && + name.equals(RTL_CONSTASCII_STRINGPARAM("component-schema"))) + { + nestedParser_ = new XcsParser(layer_, data_); + nesting_ = 1; + return nestedParser_->startElement(reader, nsId, name); + } + if (nsId == ParseManager::NAMESPACE_OOR && + name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) + { + nestedParser_ = new XcuParser(layer_ + 1, data_, 0, 0, 0); + nesting_ = 1; + return nestedParser_->startElement(reader, nsId, name); + } + break; + default: // STATE_DEPENDENCY + OSL_ASSERT(false); // this cannot happen + break; + } + throw css::uno::RuntimeException( + (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bad member <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); +} + +void XcdParser::endElement(xmlreader::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(xmlreader::Span const & text) { + if (nestedParser_.is()) { + nestedParser_->characters(text); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xcdparser.hxx b/configmgr/source/xcdparser.hxx new file mode 100644 index 000000000000..6e98160dfeff --- /dev/null +++ b/configmgr/source/xcdparser.hxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "xmlreader/xmlreader.hxx" + +#include "parser.hxx" + +namespace xmlreader { struct Span; } + +namespace configmgr { + +struct Data; + +class XcdParser: public Parser { +public: + typedef std::set< rtl::OUString > Dependencies; + + XcdParser(int layer, Dependencies const & dependencies, Data & data); + +private: + virtual ~XcdParser(); + + virtual xmlreader::XmlReader::Text getTextMode(); + + virtual bool startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); + + virtual void endElement(xmlreader::XmlReader const & reader); + + virtual void characters(xmlreader::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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx new file mode 100644 index 000000000000..c558bd9864b7 --- /dev/null +++ b/configmgr/source/xcsparser.cxx @@ -0,0 +1,671 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" + +#include "data.hxx" +#include "localizedpropertynode.hxx" +#include "groupnode.hxx" +#include "node.hxx" +#include "nodemap.hxx" +#include "parsemanager.hxx" +#include "propertynode.hxx" +#include "setnode.hxx" +#include "xcsparser.hxx" +#include "xmldata.hxx" + +namespace configmgr { + +namespace { + +namespace css = com::sun::star; + +// Conservatively merge a template or component (and its recursive parts) into +// an existing instance: +void merge( + rtl::Reference< Node > const & original, + rtl::Reference< Node > const & update) +{ + OSL_ASSERT( + original.is() && update.is() && original->kind() == update->kind() && + update->getFinalized() == Data::NO_LAYER); + if (update->getLayer() >= original->getLayer() && + update->getLayer() <= original->getFinalized()) + { + switch (original->kind()) { + case Node::KIND_PROPERTY: + case Node::KIND_LOCALIZED_PROPERTY: + case Node::KIND_LOCALIZED_VALUE: + break; //TODO: merge certain parts? + case Node::KIND_GROUP: + for (NodeMap::iterator i2(update->getMembers().begin()); + i2 != update->getMembers().end(); ++i2) + { + NodeMap::iterator i1(original->getMembers().find(i2->first)); + if (i1 == original->getMembers().end()) { + if (i2->second->kind() == Node::KIND_PROPERTY && + dynamic_cast< GroupNode * >( + original.get())->isExtensible()) + { + original->getMembers().insert(*i2); + } + } else if (i2->second->kind() == i1->second->kind()) { + merge(i1->second, i2->second); + } + } + break; + case Node::KIND_SET: + for (NodeMap::iterator i2(update->getMembers().begin()); + i2 != update->getMembers().end(); ++i2) + { + NodeMap::iterator i1(original->getMembers().find(i2->first)); + if (i1 == original->getMembers().end()) { + if (dynamic_cast< SetNode * >(original.get())-> + isValidTemplate(i2->second->getTemplateName())) + { + original->getMembers().insert(*i2); + } + } else if (i2->second->kind() == i1->second->kind() && + (i2->second->getTemplateName() == + i1->second->getTemplateName())) + { + merge(i1->second, i2->second); + } + } + break; + } + } +} + +} + +XcsParser::XcsParser(int layer, Data & data): + valueParser_(layer), data_(data), state_(STATE_START) +{} + +XcsParser::~XcsParser() {} + +xmlreader::XmlReader::Text XcsParser::getTextMode() { + return valueParser_.getTextMode(); +} + +bool XcsParser::startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) +{ + if (valueParser_.startElement(reader, nsId, name)) { + return true; + } + if (state_ == STATE_START) { + if (nsId == ParseManager::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 || + (nsId == xmlreader::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 (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("templates"))) + { + state_ = STATE_TEMPLATES; + return true; + } + // fall through + case STATE_TEMPLATES_DONE: + if (nsId == xmlreader::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 (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("group"))) + { + handleGroup(reader, true); + return true; + } + if (nsId == xmlreader::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 (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("value"))) + { + handlePropValue(reader, elements_.top().node); + return true; + } + break; + case Node::KIND_GROUP: + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) + { + handleProp(reader); + return true; + } + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("node-ref"))) + { + handleNodeRef(reader); + return true; + } + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("group"))) + { + handleGroup(reader, false); + return true; + } + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("set"))) + { + handleSet(reader, false); + return true; + } + break; + case Node::KIND_SET: + if (nsId == xmlreader::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 <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); +} + +void XcsParser::endElement(xmlreader::XmlReader const & reader) { + if (valueParser_.endElement()) { + return; + } + if (ignoring_ > 0) { + --ignoring_; + } else if (!elements_.empty()) { + Element top(elements_.top()); + elements_.pop(); + if (top.node.is()) { + if (elements_.empty()) { + switch (state_) { + case STATE_TEMPLATES: + { + NodeMap::iterator i(data_.templates.find(top.name)); + if (i == data_.templates.end()) { + data_.templates.insert( + NodeMap::value_type(top.name, top.node)); + } else { + merge(i->second, top.node); + } + } + break; + case STATE_COMPONENT: + { + NodeMap::iterator i(data_.components.find(top.name)); + if (i == data_.components.end()) { + data_.components.insert( + NodeMap::value_type(top.name, top.node)); + } else { + merge(i->second, top.node); + } + 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 if (!elements_.top().node->getMembers().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: + // To support old, broken extensions with .xcs files that contain + // empty <component-schema> elements: + state_ = STATE_COMPONENT_DONE; + break; + case STATE_TEMPLATES: + state_ = STATE_TEMPLATES_DONE; + break; + 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_COMPONENT_DONE: + break; + default: + OSL_ASSERT(false); // this cannot happen + } + } +} + +void XcsParser::characters(xmlreader::Span const & text) { + valueParser_.characters(text); +} + +void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) { + //TODO: oor:version, xml:lang attributes + rtl::OStringBuffer buf; + buf.append('.'); + bool hasPackage = false; + bool hasName = false; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::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; + xmlreader::Span s(reader.getAttributeValue(false)); + buf.insert(0, s.begin, s.length); + } else if (attrNsId == ParseManager::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; + xmlreader::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_ = xmlreader::Span(buf.getStr(), buf.getLength()). + convertFromUtf8(); +} + +void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) { + bool hasName = false; + rtl::OUString name; + rtl::OUString component(componentName_); + bool hasNodeType = false; + rtl::OUString nodeType; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) + { + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) + { + hasNodeType = true; + nodeType = reader.getAttributeValue(false).convertFromUtf8(); + } + } + 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(false)); + node->setLayer(valueParser_.getLayer()); + elements_.push(Element(node, name)); +} + +void XcsParser::handleProp(xmlreader::XmlReader & reader) { + bool hasName = false; + rtl::OUString name; + valueParser_.type_ = TYPE_ERROR; + bool localized = false; + bool nillable = true; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) + { + valueParser_.type_ = xmldata::parseType( + reader, reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("localized"))) + { + localized = xmldata::parseBoolean(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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::XmlReader & reader, rtl::Reference< Node > const & property) +{ + xmlreader::Span attrSeparator; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::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::XmlReader & reader, bool isTemplate) { + bool hasName = false; + rtl::OUString name; + bool extensible = false; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::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::XmlReader & reader, bool isTemplate) { + bool hasName = false; + rtl::OUString name; + rtl::OUString component(componentName_); + bool hasNodeType = false; + rtl::OUString nodeType; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) + { + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) + { + hasNodeType = true; + nodeType = reader.getAttributeValue(false).convertFromUtf8(); + } + } + 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::XmlReader & reader, SetNode * set) { + rtl::OUString component(componentName_); + bool hasNodeType = false; + rtl::OUString nodeType; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) + { + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) + { + hasNodeType = true; + nodeType = reader.getAttributeValue(false).convertFromUtf8(); + } + } + set->getAdditionalTemplateNames().push_back( + xmldata::parseTemplateReference(component, hasNodeType, nodeType, 0)); + elements_.push(Element(rtl::Reference< Node >(), rtl::OUString())); +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xcsparser.hxx b/configmgr/source/xcsparser.hxx new file mode 100644 index 000000000000..c259a02eaec8 --- /dev/null +++ b/configmgr/source/xcsparser.hxx @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "xmlreader/xmlreader.hxx" + +#include "node.hxx" +#include "parser.hxx" +#include "valueparser.hxx" + +namespace xmlreader { struct Span; } + +namespace configmgr { + +class SetNode; +struct Data; + +class XcsParser: public Parser { +public: + XcsParser(int layer, Data & data); + +private: + virtual ~XcsParser(); + + virtual xmlreader::XmlReader::Text getTextMode(); + + virtual bool startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); + + virtual void endElement(xmlreader::XmlReader const & reader); + + virtual void characters(xmlreader::Span const & text); + + void handleComponentSchema(xmlreader::XmlReader & reader); + + void handleNodeRef(xmlreader::XmlReader & reader); + + void handleProp(xmlreader::XmlReader & reader); + + void handlePropValue( + xmlreader::XmlReader & reader, rtl::Reference< Node > const & property); + + void handleGroup(xmlreader::XmlReader & reader, bool isTemplate); + + void handleSet(xmlreader::XmlReader & reader, bool isTemplate); + + void handleSetItem(xmlreader::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 + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx new file mode 100644 index 000000000000..3a81ea4e3673 --- /dev/null +++ b/configmgr/source/xcuparser.cxx @@ -0,0 +1,1139 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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 "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" + +#include "data.hxx" +#include "localizedpropertynode.hxx" +#include "localizedvaluenode.hxx" +#include "groupnode.hxx" +#include "modifications.hxx" +#include "node.hxx" +#include "nodemap.hxx" +#include "parsemanager.hxx" +#include "partial.hxx" +#include "path.hxx" +#include "propertynode.hxx" +#include "setnode.hxx" +#include "xcuparser.hxx" +#include "xmldata.hxx" + +namespace configmgr { + +namespace { + +namespace css = com::sun::star; + +} + +XcuParser::XcuParser( + int layer, Data & data, Partial const * partial, + Modifications * broadcastModifications, Additions * additions): + valueParser_(layer), data_(data), + partial_(partial), broadcastModifications_(broadcastModifications), + additions_(additions), recordModifications_(layer == Data::NO_LAYER), + trackPath_( + partial_ != 0 || broadcastModifications_ != 0 || additions_ != 0 || + recordModifications_) +{} + +XcuParser::~XcuParser() {} + +xmlreader::XmlReader::Text XcuParser::getTextMode() { + return valueParser_.getTextMode(); +} + +bool XcuParser::startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name) +{ + if (valueParser_.startElement(reader, nsId, name)) { + return true; + } + if (state_.empty()) { + if (nsId == ParseManager::NAMESPACE_OOR && + name.equals(RTL_CONSTASCII_STRINGPARAM("component-data"))) + { + handleComponentData(reader); + } else if (nsId == ParseManager::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 <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); + } + } else if (state_.top().ignore) { + state_.push(State(false)); + } else if (!state_.top().node.is()) { + if (nsId == xmlreader::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 <")) + + name.convertFromUtf8() + + 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 (nsId == xmlreader::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 <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); + } + break; + case Node::KIND_LOCALIZED_PROPERTY: + if (nsId == xmlreader::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 <")) + + name.convertFromUtf8() + + 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 <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); + case Node::KIND_GROUP: + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) + { + handleGroupProp( + reader, + dynamic_cast< GroupNode * >(state_.top().node.get())); + } else if (nsId == xmlreader::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 <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); + } + break; + case Node::KIND_SET: + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("node"))) + { + handleSetNode( + reader, dynamic_cast< SetNode * >(state_.top().node.get())); + } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && + name.equals(RTL_CONSTASCII_STRINGPARAM("prop"))) + { + OSL_TRACE( + "configmgr bad set node <prop> member in %s", + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored + } else { + throw css::uno::RuntimeException( + (rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("bad set node member <")) + + name.convertFromUtf8() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("> in ")) + + reader.getUrl()), + css::uno::Reference< css::uno::XInterface >()); + } + break; + } + } + return true; +} + +void XcuParser::endElement(xmlreader::XmlReader const &) { + if (valueParser_.endElement()) { + return; + } + OSL_ASSERT(!state_.empty()); + bool pop = state_.top().pop; + 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 (pop && !path_.empty()) { + path_.pop_back(); + // </item> will pop less than <item> pushed, but that is harmless, + // as the next <item> will reset path_ + } +} + +void XcuParser::characters(xmlreader::Span const & text) { + valueParser_.characters(text); +} + +XcuParser::Operation XcuParser::parseOperation(xmlreader::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 ")) + + text.convertFromUtf8()), + css::uno::Reference< css::uno::XInterface >()); +} + +void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { + rtl::OStringBuffer buf; + buf.append('.'); + bool hasPackage = false; + bool hasName = false; + Operation op = OPERATION_MODIFY; + bool finalized = false; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::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; + xmlreader::Span s(reader.getAttributeValue(false)); + buf.insert(0, s.begin, s.length); + } else if (attrNsId == ParseManager::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; + xmlreader::Span s(reader.getAttributeValue(false)); + buf.append(s.begin, s.length); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) + { + op = parseOperation(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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_ = xmlreader::Span(buf.getStr(), buf.getLength()). + convertFromUtf8(); + if (trackPath_) { + OSL_ASSERT(path_.empty()); + path_.push_back(componentName_); + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } + rtl::Reference< Node > node( + Data::findNode( + valueParser_.getLayer(), data_.components, componentName_)); + if (!node.is()) { + OSL_TRACE( + "configmgr unknown component %s in %s", + rtl::OUStringToOString( + componentName_, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored + return; + } + 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())); +} + +void XcuParser::handleItem(xmlreader::XmlReader & reader) { + xmlreader::Span attrPath; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::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(attrPath.convertFromUtf8()); + int finalizedLayer; + rtl::Reference< Node > node( + data_.resolvePathRepresentation( + path, 0, &path_, &finalizedLayer)); + if (!node.is()) { + OSL_TRACE( + "configmgr unknown item %s in %s", + rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored + return; + } + OSL_ASSERT(!path_.empty()); + componentName_ = path_.front(); + if (trackPath_) { + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } else { + path_.clear(); + } + switch (node->kind()) { + case Node::KIND_PROPERTY: + case Node::KIND_LOCALIZED_VALUE: + OSL_TRACE( + "configmgr item of bad type %s in %s", + rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored + return; + case Node::KIND_LOCALIZED_PROPERTY: + valueParser_.type_ = dynamic_cast< LocalizedPropertyNode * >( + node.get())->getStaticType(); + break; + default: + break; + } + state_.push(State(node, finalizedLayer < valueParser_.getLayer())); +} + +void XcuParser::handlePropValue( + xmlreader::XmlReader & reader, PropertyNode * prop) + { + bool nil = false; + rtl::OString separator; + rtl::OUString external; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_XSI && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil"))) + { + nil = xmldata::parseBoolean(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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 (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) + { + xmlreader::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 (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("external"))) + { + external = reader.getAttributeValue(true).convertFromUtf8(); + 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(false)); + } else if (external.getLength() == 0) { + valueParser_.separator_ = separator; + valueParser_.start(prop); + } else { + prop->setExternal(valueParser_.getLayer(), external); + state_.push(State(false)); + } +} + +void XcuParser::handleLocpropValue( + xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop) +{ + rtl::OUString name; + bool nil = false; + rtl::OString separator; + Operation op = OPERATION_FUSE; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("lang"))) + { + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_XSI && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("nil"))) + { + nil = xmldata::parseBoolean(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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 (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("separator"))) + { + xmlreader::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 (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) + { + op = parseOperation(reader.getAttributeValue(true)); + } + } + if (trackPath_) { + path_.push_back(name); + if (partial_ != 0 && + partial_->contains(path_) != Partial::CONTAINS_NODE) + { + state_.push(State(true)); // ignored + return; + } + } + NodeMap::iterator i(locprop->getMembers().find(name)); + if (i != locprop->getMembers().end() && + i->second->getLayer() > valueParser_.getLayer()) + { + state_.push(State(true)); // 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: + { + bool pop = false; + 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(true)); + } else { + valueParser_.separator_ = separator; + valueParser_.start(locprop, name); + pop = true; + } + if (trackPath_) { + recordModification(false); + if (pop) { + path_.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(true)); + recordModification(false); + 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::XmlReader & reader, GroupNode * group) +{ + bool hasName = false; + rtl::OUString name; + Type type = TYPE_ERROR; + Operation op = OPERATION_MODIFY; + bool finalized = false; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("type"))) + { + type = xmldata::parseType(reader, reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) + { + op = parseOperation(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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 >()); + } + if (trackPath_) { + path_.push_back(name); + //TODO: This ignores locprop values for which specific include paths + // exist (i.e., for which contains(locprop path) = CONTAINS_SUBNODES): + if (partial_ != 0 && + partial_->contains(path_) != Partial::CONTAINS_NODE) + { + state_.push(State(true)); // ignored + return; + } + } + 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::XmlReader const & reader, GroupNode * group, + rtl::OUString const & name, Type type, Operation operation, bool finalized) +{ + switch (operation) { + case OPERATION_REPLACE: + case OPERATION_FUSE: + if (group->isExtensible()) { + 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)); + recordModification(false); + break; + } + // fall through + default: + OSL_TRACE( + "configmgr unknown property %s in %s", + rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored + break; + } +} + +void XcuParser::handlePlainGroupProp( + xmlreader::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(true)); // 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()))); + recordModification(false); + 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(true)); // ignore children + recordModification(false); + break; + } +} + +void XcuParser::handleLocalizedGroupProp( + xmlreader::XmlReader const & reader, LocalizedPropertyNode * property, + rtl::OUString const & name, Type type, Operation operation, bool finalized) +{ + if (property->getLayer() > valueParser_.getLayer()) { + state_.push(State(true)); // 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()))); + 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()))); + recordModification(false); + } + 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::XmlReader & reader, rtl::Reference< Node > const & group) +{ + bool hasName = false; + rtl::OUString name; + Operation op = OPERATION_MODIFY; + bool finalized = false; + for (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) + { + op = parseOperation(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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 >()); + } + if (trackPath_) { + path_.push_back(name); + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } + rtl::Reference< Node > child( + Data::findNode(valueParser_.getLayer(), group->getMembers(), name)); + if (!child.is()) { + OSL_TRACE( + "configmgr unknown node %s in %s", + rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(), + rtl::OUStringToOString( + reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr()); + state_.push(State(true)); // ignored + return; + } + 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())); +} + +void XcuParser::handleSetNode(xmlreader::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 (;;) { + int attrNsId; + xmlreader::Span attrLn; + if (!reader.nextAttribute(&attrNsId, &attrLn)) { + break; + } + if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("name"))) + { + hasName = true; + name = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("component"))) + { + component = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("node-type"))) + { + hasNodeType = true; + nodeType = reader.getAttributeValue(false).convertFromUtf8(); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("op"))) + { + op = parseOperation(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::NAMESPACE_OOR && + attrLn.equals(RTL_CONSTASCII_STRINGPARAM("finalized"))) + { + finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); + } else if (attrNsId == ParseManager::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 >()); + } + if (trackPath_) { + path_.push_back(name); + if (partial_ != 0 && partial_->contains(path_) == Partial::CONTAINS_NOT) + { + state_.push(State(true)); // ignored + return; + } + } + 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(true)); // ignored + return; + } + } + switch (op) { + case OPERATION_MODIFY: + if (i == set->getMembers().end()) { + OSL_TRACE("ignoring modify of unknown set member node"); + state_.push(State(true)); // ignored + } else { + state_.push( + State( + i->second, + (state_.top().locked || + finalizedLayer < valueParser_.getLayer()))); + } + break; + case OPERATION_REPLACE: + if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) { + state_.push(State(true)); // ignored + } else { + rtl::Reference< Node > member(tmpl->clone(true)); + member->setLayer(valueParser_.getLayer()); + member->setFinalized(finalizedLayer); + member->setMandatory(mandatoryLayer); + state_.push(State(member, name, false)); + recordModification(i == set->getMembers().end()); + } + break; + case OPERATION_FUSE: + if (i == set->getMembers().end()) { + if (state_.top().locked || finalizedLayer < valueParser_.getLayer()) + { + state_.push(State(true)); // ignored + } else { + rtl::Reference< Node > member(tmpl->clone(true)); + member->setLayer(valueParser_.getLayer()); + member->setFinalized(finalizedLayer); + member->setMandatory(mandatoryLayer); + state_.push(State(member, name, false)); + recordModification(true); + } + } else { + state_.push( + State( + i->second, + (state_.top().locked || + finalizedLayer < valueParser_.getLayer()))); + } + 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; + // forget about user-layer removals that no longer remove anything + // (so that paired additions/removals in the user layer do not grow + // registrymodifications.xcu unbounded): + bool known = i != set->getMembers().end(); + if (known && !state_.top().locked && + finalizedLayer >= valueParser_.getLayer() && + mandatoryLayer > valueParser_.getLayer()) + { + set->getMembers().erase(i); + } + state_.push(State(true)); + if (known) { + recordModification(false); + } + break; + } + } +} + +void XcuParser::recordModification(bool addition) { + if (broadcastModifications_ != 0) { + broadcastModifications_->add(path_); + } + if (addition && additions_ != 0) { + additions_->push_back(path_); + } + if (recordModifications_) { + data_.modifications.add(path_); + } +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xcuparser.hxx b/configmgr/source/xcuparser.hxx new file mode 100644 index 000000000000..dda51d254f37 --- /dev/null +++ b/configmgr/source/xcuparser.hxx @@ -0,0 +1,160 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 "xmlreader/xmlreader.hxx" + +#include "additions.hxx" +#include "node.hxx" +#include "nodemap.hxx" +#include "parser.hxx" +#include "path.hxx" +#include "type.hxx" +#include "valueparser.hxx" +#include "xmldata.hxx" + +namespace xmlreader { struct Span; } + +namespace configmgr { + +class GroupNode; +class LocalizedPropertyNode; +class Modifications; +class Partial; +class PropertyNode; +class SetNode; +struct Data; + +class XcuParser: public Parser { +public: + XcuParser( + int layer, Data & data, Partial const * partial, + Modifications * broadcastModifications, Additions * additions); + +private: + virtual ~XcuParser(); + + virtual xmlreader::XmlReader::Text getTextMode(); + + virtual bool startElement( + xmlreader::XmlReader & reader, int nsId, xmlreader::Span const & name); + + virtual void endElement(xmlreader::XmlReader const & reader); + + virtual void characters(xmlreader::Span const & span); + + enum Operation { + OPERATION_MODIFY, OPERATION_REPLACE, OPERATION_FUSE, OPERATION_REMOVE }; + + static Operation parseOperation(xmlreader::Span const & text); + + void handleComponentData(xmlreader::XmlReader & reader); + + void handleItem(xmlreader::XmlReader & reader); + + void handlePropValue(xmlreader::XmlReader & reader, PropertyNode * prop); + + void handleLocpropValue( + xmlreader::XmlReader & reader, LocalizedPropertyNode * locprop); + + void handleGroupProp(xmlreader::XmlReader & reader, GroupNode * group); + + void handleUnknownGroupProp( + xmlreader::XmlReader const & reader, GroupNode * group, + rtl::OUString const & name, Type type, Operation operation, + bool finalized); + + void handlePlainGroupProp( + xmlreader::XmlReader const & reader, GroupNode * group, + NodeMap::iterator const & propertyIndex, rtl::OUString const & name, + Type type, Operation operation, bool finalized); + + void handleLocalizedGroupProp( + xmlreader::XmlReader const & reader, LocalizedPropertyNode * property, + rtl::OUString const & name, Type type, Operation operation, + bool finalized); + + void handleGroupNode( + xmlreader::XmlReader & reader, rtl::Reference< Node > const & group); + + void handleSetNode(xmlreader::XmlReader & reader, SetNode * set); + + void recordModification(bool addition); + + 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; + bool pop; + + inline State(bool thePop): + ignore(true), insert(false), locked(false), pop(thePop) + {} + + inline State(rtl::Reference< Node > const & theNode, bool theLocked): + node(theNode), ignore(false), insert(false), locked(theLocked), + pop(true) + {} + + inline State( + rtl::Reference< Node > const & theNode, + rtl::OUString const & theName, bool theLocked): + node(theNode), name(theName), ignore(false), insert(true), + locked(theLocked), pop(true) + {} + }; + + typedef std::stack< State > StateStack; + + ValueParser valueParser_; + Data & data_; + Partial const * partial_; + Modifications * broadcastModifications_; + Additions * additions_; + bool recordModifications_; + bool trackPath_; + rtl::OUString componentName_; + StateStack state_; + Path path_; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx new file mode 100644 index 000000000000..5120506bfbb4 --- /dev/null +++ b/configmgr/source/xmldata.cxx @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General 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/ustrbuf.hxx" +#include "rtl/ustring.h" +#include "rtl/ustring.hxx" +#include "sal/types.h" +#include "xmlreader/span.hxx" +#include "xmlreader/xmlreader.hxx" + +#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 "type.hxx" + +namespace configmgr { + +namespace xmldata { + +namespace { + +namespace css = com::sun::star; + +} + +Type parseType( + xmlreader::XmlReader const & reader, xmlreader::Span const & text) +{ + OSL_ASSERT(text.is()); + sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':'); + if (i >= 0) { + switch (reader.getNamespaceId(xmlreader::Span(text.begin, i))) { + case ParseManager::NAMESPACE_OOR: + if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("any"))) + { + return TYPE_ANY; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("boolean-list"))) + { + return TYPE_BOOLEAN_LIST; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("short-list"))) + { + return TYPE_SHORT_LIST; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("int-list"))) + { + return TYPE_INT_LIST; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("long-list"))) + { + return TYPE_LONG_LIST; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("double-list"))) + { + return TYPE_DOUBLE_LIST; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("string-list"))) + { + return TYPE_STRING_LIST; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("hexBinary-list"))) + { + return TYPE_HEXBINARY_LIST; + } + break; + case ParseManager::NAMESPACE_XS: + if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("boolean"))) + { + return TYPE_BOOLEAN; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("short"))) + { + return TYPE_SHORT; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("int"))) + { + return TYPE_INT; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("long"))) + { + return TYPE_LONG; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("double"))) + { + return TYPE_DOUBLE; + } else if (xmlreader::Span( + text.begin + i + 1, text.length - (i + 1)). + equals(RTL_CONSTASCII_STRINGPARAM("string"))) + { + return TYPE_STRING; + } else if (xmlreader::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 ")) + + text.convertFromUtf8()), + css::uno::Reference< css::uno::XInterface >()); +} + +bool parseBoolean(xmlreader::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 ")) + + text.convertFromUtf8()), + 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); +} + +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/xmldata.hxx b/configmgr/source/xmldata.hxx new file mode 100644 index 000000000000..2b35adaae4f9 --- /dev/null +++ b/configmgr/source/xmldata.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public 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 xmlreader { + class XmlReader; + struct Span; +} + +namespace configmgr { + +namespace xmldata { + +Type parseType( + xmlreader::XmlReader const & reader, xmlreader::Span const & text); + +bool parseBoolean(xmlreader::Span const & text); + +rtl::OUString parseTemplateReference( + rtl::OUString const & component, bool hasNodeType, + rtl::OUString const & nodeType, rtl::OUString const * defaultTemplateName); + +} + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |