diff options
author | sb <sb@openoffice.org> | 2010-09-10 13:10:07 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2010-09-10 13:10:07 +0200 |
commit | 5dbc43ead1b7ff5fa0c1f6756a9ca6062c48d033 (patch) | |
tree | 5edda4f51842da35f56ef41ca0b6ce8d98f14d01 /forms | |
parent | ec38ffb43215161d6f0f8769f870e76850c8161c (diff) |
sb129: #i113189# change UNO components to use passive registration
Diffstat (limited to 'forms')
-rw-r--r-- | forms/prj/d.lst | 1 | ||||
-rw-r--r-- | forms/source/inc/forms_module.hxx | 15 | ||||
-rw-r--r-- | forms/source/inc/forms_module_impl.hxx | 48 | ||||
-rw-r--r-- | forms/source/misc/services.cxx | 67 | ||||
-rw-r--r-- | forms/util/frm.component | 259 | ||||
-rw-r--r-- | forms/util/frm.dxp | 1 | ||||
-rw-r--r-- | forms/util/makefile.mk | 8 |
7 files changed, 268 insertions, 131 deletions
diff --git a/forms/prj/d.lst b/forms/prj/d.lst index de1655d7d7f8..a708dd3e3bc9 100644 --- a/forms/prj/d.lst +++ b/forms/prj/d.lst @@ -5,3 +5,4 @@ ..\%__SRC%\bin\*.bin %_DEST%\bin%_EXT%\*.bin ..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res ..\util\*.xml %_DEST%\xml%_EXT%\*.xml +..\%__SRC%\misc\frm.component %_DEST%\xml%_EXT%\frm.component diff --git a/forms/source/inc/forms_module.hxx b/forms/source/inc/forms_module.hxx index 6655fb750e8d..912323d93194 100644 --- a/forms/source/inc/forms_module.hxx +++ b/forms/source/inc/forms_module.hxx @@ -101,21 +101,6 @@ namespace FORMS_MODULE_NAMESPACE static void revokeComponent( const ::rtl::OUString& _rImplementationName); - /** write the registration information of all known components - <p>writes the registration information of all components which are currently registered into the - specified registry.<p/> - <p>Usually used from within component_writeInfo.<p/> - @param _rxServiceManager - the service manager - @param _rRootKey - the registry key under which the information will be stored - @return - sal_True if the registration of all implementations was successfull, sal_False otherwise - */ - static sal_Bool writeComponentInfos( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager, - const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey); - /** creates a Factory for the component with the given implementation name. <p>Usually used from within component_getFactory.<p/> @param _rxServiceManager diff --git a/forms/source/inc/forms_module_impl.hxx b/forms/source/inc/forms_module_impl.hxx index a2c0e50e55e7..d10527075ae3 100644 --- a/forms/source/inc/forms_module_impl.hxx +++ b/forms/source/inc/forms_module_impl.hxx @@ -107,54 +107,6 @@ namespace FORMS_MODULE_NAMESPACE } //-------------------------------------------------------------------------- - sal_Bool OFormsModule::writeComponentInfos( - const Reference< XMultiServiceFactory >& /*_rxServiceManager*/, - const Reference< XRegistryKey >& _rxRootKey) - { - OSL_ENSURE(_rxRootKey.is(), "OFormsModule::writeComponentInfos : invalid argument !"); - - if (!s_pImplementationNames) - { - OSL_ASSERT("OFormsModule::writeComponentInfos : have no class infos ! Are you sure called this method at the right time ?"); - return sal_True; - } - OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, - "OFormsModule::writeComponentInfos : inconsistent state (the pointers) !"); - OSL_ENSURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength()) - && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength()) - && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()), - "OFormsModule::writeComponentInfos : inconsistent state !"); - - sal_Int32 nLen = s_pImplementationNames->getLength(); - const ::rtl::OUString* pImplName = s_pImplementationNames->getConstArray(); - const Sequence< ::rtl::OUString >* pServices = s_pSupportedServices->getConstArray(); - - ::rtl::OUString sRootKey("/", 1, RTL_TEXTENCODING_ASCII_US); - for (sal_Int32 i=0; i<nLen; ++i, ++pImplName, ++pServices) - { - ::rtl::OUString aMainKeyName(sRootKey); - aMainKeyName += *pImplName; - aMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES"); - - try - { - Reference< XRegistryKey > xNewKey( _rxRootKey->createKey(aMainKeyName) ); - - const ::rtl::OUString* pService = pServices->getConstArray(); - for (sal_Int32 j=0; j<pServices->getLength(); ++j, ++pService) - xNewKey->createKey(*pService); - } - catch(Exception&) - { - OSL_ASSERT("OFormsModule::writeComponentInfos : something went wrong while creating the keys !"); - return sal_False; - } - } - - return sal_True; - } - - //-------------------------------------------------------------------------- Reference< XInterface > OFormsModule::getComponentFactory( const ::rtl::OUString& _rImplementationName, const Reference< XMultiServiceFactory >& _rxServiceManager) diff --git a/forms/source/misc/services.cxx b/forms/source/misc/services.cxx index dbda0ae3896d..9a38d49e3e67 100644 --- a/forms/source/misc/services.cxx +++ b/forms/source/misc/services.cxx @@ -283,22 +283,6 @@ void ensureClassInfos() } -//--------------------------------------------------------------------------------------- -void registerServiceProvider(const ::rtl::OUString& _rServiceImplName, const Sequence< ::rtl::OUString >& _rServices, XRegistryKey* _pKey) -{ - ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/"); - sMainKeyName += _rServiceImplName; - sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES"); - Reference< XRegistryKey > xNewKey = _pKey->createKey(sMainKeyName); - OSL_ENSURE(xNewKey.is(), "forms::registerProvider : could not create a registry key !"); - if (!xNewKey.is()) - return; - - const ::rtl::OUString* pSupportedServices = _rServices.getConstArray(); - for (sal_Int32 i=0; i<_rServices.getLength(); ++i, ++pSupportedServices) - xNewKey->createKey(*pSupportedServices); -} - //======================================================================================= extern "C" { @@ -342,57 +326,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const } //--------------------------------------------------------------------------------------- -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* _pServiceManager, XRegistryKey* _pRegistryKey) -{ - if (_pRegistryKey) - { - try - { - // ======================================================================== - // the real way - use the OModule - createRegistryInfo_FORMS(); - if ( !::frm::OFormsModule::writeComponentInfos( - static_cast<XMultiServiceFactory*>( _pServiceManager ), - static_cast<XRegistryKey*>( _pRegistryKey ) ) - ) - return sal_False; - - // ======================================================================== - // a lot of stuff which is implemented "manually" here in this file - - // collect the class infos - ensureClassInfos(); - - // both our static sequences should have the same length ... - sal_Int32 nClasses = s_aClassImplementationNames.getLength(); - OSL_ENSURE(s_aClassServiceNames.getLength() == nClasses, - "forms::component_writeInfo : invalid class infos !"); - - // loop through the sequences and register the service providers - const ::rtl::OUString* pClasses = s_aClassImplementationNames.getConstArray(); - const Sequence< ::rtl::OUString >* pServices = s_aClassServiceNames.getConstArray(); - - for (sal_Int32 i=0; i<nClasses; ++i, ++pClasses, ++pServices) - registerServiceProvider(*pClasses, *pServices, _pRegistryKey); - - s_aClassImplementationNames.realloc(0); - s_aClassServiceNames.realloc(0); - s_aFactories.realloc(0); - - return sal_True; - } - catch ( InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "forms::component_writeInfo : InvalidRegistryException !"); - } - } - s_aClassImplementationNames.realloc(0); - s_aClassServiceNames.realloc(0); - s_aFactories.realloc(0); - return sal_False; -} - -//--------------------------------------------------------------------------------------- SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/) { if (!_pServiceManager || !_pImplName) diff --git a/forms/util/frm.component b/forms/util/frm.component new file mode 100644 index 000000000000..0305d03ed54e --- /dev/null +++ b/forms/util/frm.component @@ -0,0 +1,259 @@ +<?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.form.ONavigationBarControl"> + <service name="com.sun.star.awt.UnoControl"/> + <service name="com.sun.star.form.control.NavigationToolBar"/> + </implementation> + <implementation name="com.sun.star.comp.form.ONavigationBarModel"> + <service name="com.sun.star.awt.UnoControlModel"/> + <service name="com.sun.star.form.FormComponent"/> + <service name="com.sun.star.form.FormControlModel"/> + <service name="com.sun.star.form.component.NavigationToolBar"/> + </implementation> + <implementation name="com.sun.star.comp.form.ORichTextControl"> + <service name="com.sun.star.awt.UnoControl"/> + <service name="com.sun.star.awt.UnoControlEdit"/> + <service name="com.sun.star.form.control.RichTextControl"/> + </implementation> + <implementation name="com.sun.star.comp.forms.FormOperations"> + <service name="com.sun.star.form.runtime.FormOperations"/> + </implementation> + <implementation name="com.sun.star.comp.forms.ODatabaseForm"> + <service name="com.sun.star.form.FormComponent"/> + <service name="com.sun.star.form.FormComponents"/> + <service name="com.sun.star.form.component.DataForm"/> + <service name="com.sun.star.form.component.Form"/> + <service name="com.sun.star.form.component.HTMLForm"/> + <service name="stardiv.one.form.component.Form"/> + </implementation> + <implementation name="com.sun.star.comp.forms.OFilterControl"> + <service name="com.sun.star.awt.UnoControl"/> + <service name="com.sun.star.form.control.FilterControl"/> + </implementation> + <implementation name="com.sun.star.comp.forms.OFormattedFieldWrapper_ForcedFormatted"> + <service name="com.sun.star.form.binding.BindableDatabaseFormattedField"/> + <service name="com.sun.star.form.component.DatabaseFormattedField"/> + <service name="com.sun.star.form.component.FormattedField"/> + <service name="stardiv.one.form.component.FormattedField"/> + </implementation> + <implementation name="com.sun.star.comp.forms.ORichTextModel"> + <service name="com.sun.star.form.FormComponent"/> + <service name="com.sun.star.form.FormControlModel"/> + <service name="com.sun.star.form.component.RichTextControl"/> + <service name="com.sun.star.style.CharacterProperties"/> + <service name="com.sun.star.style.CharacterPropertiesAsian"/> + <service name="com.sun.star.style.CharacterPropertiesComplex"/> + <service name="com.sun.star.style.ParagraphProperties"/> + <service name="com.sun.star.style.ParagraphPropertiesComplex"/> + <service name="com.sun.star.text.TextRange"/> + </implementation> + <implementation name="com.sun.star.comp.forms.OScrollBarModel"> + <service name="com.sun.star.form.FormComponent"/> + <service name="com.sun.star.form.FormControlModel"/> + <service name="com.sun.star.form.binding.BindableIntegerValueRange"/> + <service name="com.sun.star.form.component.ScrollBar"/> + </implementation> + <implementation name="com.sun.star.comp.forms.OSpinButtonModel"> + <service name="com.sun.star.form.FormComponent"/> + <service name="com.sun.star.form.FormControlModel"/> + <service name="com.sun.star.form.binding.BindableIntegerValueRange"/> + <service name="com.sun.star.form.component.SpinButton"/> + </implementation> + <implementation name="com.sun.star.comp.xml.xpath.XFormsExtension"> + <service name="com.sun.star.xml.xpath.XPathExtension"/> + </implementation> + <implementation name="com.sun.star.form.ImageProducer"> + <service name="com.sun.star.awt.ImageProducer"/> + </implementation> + <implementation name="com.sun.star.form.Model"> + <service name="com.sun.star.xforms.Model"/> + </implementation> + <implementation name="com.sun.star.form.OButtonControl"> + <service name="com.sun.star.form.control.CommandButton"/> + <service name="stardiv.one.form.control.CommandButton"/> + </implementation> + <implementation name="com.sun.star.form.OButtonModel"> + <service name="com.sun.star.form.component.CommandButton"/> + <service name="stardiv.one.form.component.CommandButton"/> + </implementation> + <implementation name="com.sun.star.form.OCheckBoxControl"> + <service name="com.sun.star.form.control.CheckBox"/> + <service name="stardiv.one.form.control.CheckBox"/> + </implementation> + <implementation name="com.sun.star.form.OCheckBoxModel"> + <service name="com.sun.star.form.binding.BindableDatabaseCheckBox"/> + <service name="com.sun.star.form.component.CheckBox"/> + <service name="com.sun.star.form.component.DatabaseCheckBox"/> + <service name="stardiv.one.form.component.CheckBox"/> + </implementation> + <implementation name="com.sun.star.form.OComboBoxControl"> + <service name="com.sun.star.form.control.ComboBox"/> + <service name="stardiv.one.form.control.ComboBox"/> + </implementation> + <implementation name="com.sun.star.form.OComboBoxModel"> + <service name="com.sun.star.form.binding.BindableDatabaseComboBox"/> + <service name="com.sun.star.form.component.ComboBox"/> + <service name="com.sun.star.form.component.DatabaseComboBox"/> + <service name="stardiv.one.form.component.ComboBox"/> + </implementation> + <implementation name="com.sun.star.form.OCurrencyControl"> + <service name="com.sun.star.form.control.CurrencyField"/> + <service name="stardiv.one.form.control.CurrencyField"/> + </implementation> + <implementation name="com.sun.star.form.OCurrencyModel"> + <service name="com.sun.star.form.component.CurrencyField"/> + <service name="com.sun.star.form.component.DatabaseCurrencyField"/> + <service name="stardiv.one.form.component.CurrencyField"/> + </implementation> + <implementation name="com.sun.star.form.ODateControl"> + <service name="com.sun.star.form.control.DateField"/> + <service name="stardiv.one.form.control.DateField"/> + </implementation> + <implementation name="com.sun.star.form.ODateModel"> + <service name="com.sun.star.form.component.DatabaseDateField"/> + <service name="com.sun.star.form.component.DateField"/> + <service name="stardiv.one.form.component.DateField"/> + </implementation> + <implementation name="com.sun.star.form.OEditControl"> + <service name="com.sun.star.form.control.TextField"/> + <service name="stardiv.one.form.control.Edit"/> + <service name="stardiv.one.form.control.TextField"/> + </implementation> + <implementation name="com.sun.star.form.OEditModel"> + <service name="com.sun.star.form.binding.BindableDatabaseTextField"/> + <service name="com.sun.star.form.component.DatabaseTextField"/> + <service name="com.sun.star.form.component.TextField"/> + <service name="stardiv.one.form.component.TextField"/> + </implementation> + <implementation name="com.sun.star.form.OFileControlModel"> + <service name="com.sun.star.form.component.FileControl"/> + <service name="stardiv.one.form.component.FileControl"/> + </implementation> + <implementation name="com.sun.star.form.OFixedTextModel"> + <service name="com.sun.star.form.component.FixedText"/> + <service name="stardiv.one.form.component.FixedText"/> + </implementation> + <implementation name="com.sun.star.form.OFormattedControl"> + <service name="com.sun.star.form.control.FormattedField"/> + <service name="stardiv.one.form.control.FormattedField"/> + </implementation> + <implementation name="com.sun.star.form.OFormattedFieldWrapper"> + <service name="stardiv.one.form.component.Edit"/> + </implementation> + <implementation name="com.sun.star.form.OFormsCollection"> + <service name="com.sun.star.form.Forms"/> + </implementation> + <implementation name="com.sun.star.form.OGridControlModel"> + <service name="com.sun.star.form.component.GridControl"/> + <service name="stardiv.one.form.component.Grid"/> + <service name="stardiv.one.form.component.GridControl"/> + </implementation> + <implementation name="com.sun.star.form.OGroupBoxControl"> + <service name="com.sun.star.form.control.GroupBox"/> + <service name="stardiv.one.form.control.GroupBox"/> + </implementation> + <implementation name="com.sun.star.form.OGroupBoxModel"> + <service name="com.sun.star.form.component.GroupBox"/> + <service name="stardiv.one.form.component.GroupBox"/> + </implementation> + <implementation name="com.sun.star.form.OHiddenModel"> + <service name="com.sun.star.form.component.HiddenControl"/> + <service name="stardiv.one.form.component.Hidden"/> + <service name="stardiv.one.form.component.HiddenControl"/> + </implementation> + <implementation name="com.sun.star.form.OImageButtonControl"> + <service name="com.sun.star.form.control.ImageButton"/> + <service name="stardiv.one.form.control.ImageButton"/> + </implementation> + <implementation name="com.sun.star.form.OImageButtonModel"> + <service name="com.sun.star.form.component.ImageButton"/> + <service name="stardiv.one.form.component.ImageButton"/> + </implementation> + <implementation name="com.sun.star.form.OImageControlControl"> + <service name="com.sun.star.form.control.ImageControl"/> + <service name="stardiv.one.form.control.ImageControl"/> + </implementation> + <implementation name="com.sun.star.form.OImageControlModel"> + <service name="com.sun.star.form.component.DatabaseImageControl"/> + <service name="stardiv.one.form.component.ImageControl"/> + </implementation> + <implementation name="com.sun.star.form.OListBoxControl"> + <service name="com.sun.star.form.control.ListBox"/> + <service name="stardiv.one.form.control.ListBox"/> + </implementation> + <implementation name="com.sun.star.form.OListBoxModel"> + <service name="com.sun.star.form.binding.BindableDatabaseListBox"/> + <service name="com.sun.star.form.component.DatabaseListBox"/> + <service name="com.sun.star.form.component.ListBox"/> + <service name="stardiv.one.form.component.ListBox"/> + </implementation> + <implementation name="com.sun.star.form.ONumericControl"> + <service name="com.sun.star.form.control.NumericField"/> + <service name="stardiv.one.form.control.NumericField"/> + </implementation> + <implementation name="com.sun.star.form.ONumericModel"> + <service name="com.sun.star.form.binding.BindableDatabaseNumericField"/> + <service name="com.sun.star.form.component.DatabaseNumericField"/> + <service name="com.sun.star.form.component.NumericField"/> + <service name="stardiv.one.form.component.NumericField"/> + </implementation> + <implementation name="com.sun.star.form.OPatternControl"> + <service name="com.sun.star.form.control.PatternField"/> + <service name="stardiv.one.form.control.PatternField"/> + </implementation> + <implementation name="com.sun.star.form.OPatternModel"> + <service name="com.sun.star.form.component.DatabasePatternField"/> + <service name="com.sun.star.form.component.PatternField"/> + <service name="stardiv.one.form.component.PatternField"/> + </implementation> + <implementation name="com.sun.star.form.ORadioButtonControl"> + <service name="com.sun.star.form.control.RadioButton"/> + <service name="stardiv.one.form.control.RadioButton"/> + </implementation> + <implementation name="com.sun.star.form.ORadioButtonModel"> + <service name="com.sun.star.form.binding.BindableDatabaseRadioButton"/> + <service name="com.sun.star.form.component.DatabaseRadioButton"/> + <service name="com.sun.star.form.component.RadioButton"/> + <service name="stardiv.one.form.component.RadioButton"/> + </implementation> + <implementation name="com.sun.star.form.OTimeControl"> + <service name="com.sun.star.form.control.TimeField"/> + <service name="stardiv.one.form.control.TimeField"/> + </implementation> + <implementation name="com.sun.star.form.OTimeModel"> + <service name="com.sun.star.form.component.DatabaseTimeField"/> + <service name="com.sun.star.form.component.TimeField"/> + <service name="stardiv.one.form.component.TimeField"/> + </implementation> + <implementation name="com.sun.star.form.XForms"> + <service name="com.sun.star.xforms.XForms"/> + </implementation> +</component> diff --git a/forms/util/frm.dxp b/forms/util/frm.dxp index 9e59e94034a6..f0e1c69934bc 100644 --- a/forms/util/frm.dxp +++ b/forms/util/frm.dxp @@ -1,3 +1,2 @@ -component_writeInfo component_getImplementationEnvironment component_getFactory diff --git a/forms/util/makefile.mk b/forms/util/makefile.mk index 00d7a81d5a97..5ce7dd2566d2 100644 --- a/forms/util/makefile.mk +++ b/forms/util/makefile.mk @@ -112,3 +112,11 @@ $(MISC)$/$(SHL1TARGET).flt: makefile.mk @echo NavigationToolBar >>$@ @echo ONavigationBar >>$@ + +ALLTAR : $(MISC)/frm.component + +$(MISC)/frm.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + frm.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt frm.component |