diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-03 13:30:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-04 16:29:53 +0200 |
commit | a20f9a410fdd3f776f870434bc39219d5fc64b40 (patch) | |
tree | 079278e5859c5782fbe9bfcc34302d09bd8dfadd /framework | |
parent | bd6b41bce491ac5a5f562652b7e32045cc22c35c (diff) |
fdo#46808, Adapt xml::sax::XParser UNO service to new style
The xml.sax.Parser service already existed, it just did not have
a new-style service to create it.
Change-Id: I6f145a7504ff9e149c802f723991954a2801cbc9
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/framework/configimporter.hxx | 4 | ||||
-rw-r--r-- | framework/inc/framework/statusbarconfiguration.hxx | 3 | ||||
-rw-r--r-- | framework/inc/framework/toolboxconfiguration.hxx | 3 | ||||
-rw-r--r-- | framework/inc/services.h | 1 | ||||
-rw-r--r-- | framework/inc/xml/imagesconfiguration.hxx | 3 | ||||
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 5 | ||||
-rw-r--r-- | framework/source/fwe/helper/configimporter.cxx | 5 | ||||
-rw-r--r-- | framework/source/fwe/xml/menuconfiguration.cxx | 5 | ||||
-rw-r--r-- | framework/source/fwe/xml/statusbarconfiguration.cxx | 10 | ||||
-rw-r--r-- | framework/source/fwe/xml/toolboxconfiguration.cxx | 10 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.cxx | 3 | ||||
-rw-r--r-- | framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 5 | ||||
-rw-r--r-- | framework/source/uiconfiguration/uiconfigurationmanager.cxx | 5 | ||||
-rw-r--r-- | framework/source/xml/imagesconfiguration.cxx | 10 |
14 files changed, 39 insertions, 33 deletions
diff --git a/framework/inc/framework/configimporter.hxx b/framework/inc/framework/configimporter.hxx index 1fdca6bbcd67..ab151ee8d059 100644 --- a/framework/inc/framework/configimporter.hxx +++ b/framework/inc/framework/configimporter.hxx @@ -23,7 +23,7 @@ #include <com/sun/star/container/XIndexContainer.hpp> #include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/ui/XUIConfigurationManager.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <rtl/ustring.hxx> #include <framework/fwedllapi.h> @@ -36,7 +36,7 @@ namespace framework static sal_Bool ImportCustomToolbars( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationManager >& rContainerFactory, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > >& rSeqContainer, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rToolbarStorage ); }; diff --git a/framework/inc/framework/statusbarconfiguration.hxx b/framework/inc/framework/statusbarconfiguration.hxx index 2ef90ada727b..2c405c797573 100644 --- a/framework/inc/framework/statusbarconfiguration.hxx +++ b/framework/inc/framework/statusbarconfiguration.hxx @@ -36,6 +36,7 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XIndexContainer.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> namespace framework { @@ -44,7 +45,7 @@ class FWE_DLLPUBLIC StatusBarConfiguration { public: static sal_Bool LoadStatusBar( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInputStream, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rStatusbarConfiguration ); diff --git a/framework/inc/framework/toolboxconfiguration.hxx b/framework/inc/framework/toolboxconfiguration.hxx index e2c1270c0338..1e31bbb8dbac 100644 --- a/framework/inc/framework/toolboxconfiguration.hxx +++ b/framework/inc/framework/toolboxconfiguration.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/container/XIndexContainer.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> namespace framework { @@ -36,7 +37,7 @@ class FWE_DLLPUBLIC ToolBoxConfiguration { public: static sal_Bool LoadToolBox( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rToolbarConfiguration ); diff --git a/framework/inc/services.h b/framework/inc/services.h index dbdd10183b9f..70956ec6d9e4 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -80,7 +80,6 @@ namespace framework{ #define SERVICENAME_GLOBALACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.GlobalAcceleratorConfiguration") #define SERVICENAME_MODULEACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.ModuleAcceleratorConfiguration") #define SERVICENAME_DOCUMENTACCELERATORCONFIGURATION DECLARE_ASCII("com.sun.star.ui.DocumentAcceleratorConfiguration") -#define SERVICENAME_SAXPARSER DECLARE_ASCII("com.sun.star.xml.sax.Parser" ) #define SERVICENAME_SAXWRITER DECLARE_ASCII("com.sun.star.xml.sax.Writer" ) #define SERVICENAME_STORAGEFACTORY DECLARE_ASCII("com.sun.star.embed.StorageFactory" ) #define SERVICENAME_FILESYSTEMSTORAGEFACTORY DECLARE_ASCII("com.sun.star.embed.FileSystemStorageFactory" ) diff --git a/framework/inc/xml/imagesconfiguration.hxx b/framework/inc/xml/imagesconfiguration.hxx index 2a5c7aea3e8b..eda31f41571b 100644 --- a/framework/inc/xml/imagesconfiguration.hxx +++ b/framework/inc/xml/imagesconfiguration.hxx @@ -37,6 +37,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <vector> #include <boost/ptr_container/ptr_vector.hpp> @@ -100,7 +101,7 @@ class ImagesConfiguration { public: static sal_Bool LoadImages( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream, ImageListsDescriptor& rItems ); diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index d8c0732b935b..fa010e7d55bb 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -41,7 +41,7 @@ #include <acceleratorconst.h> #include <services.h> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/embed/ElementModes.hpp> @@ -56,6 +56,7 @@ #include <com/sun/star/awt/KeyModifier.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/util/XChangesNotifier.hpp> +#include <comphelper/componentcontext.hxx> #include <comphelper/configurationhelper.hxx> #include <unotools/configpaths.hxx> #include <rtl/logfile.hxx> @@ -522,7 +523,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< c css::uno::Reference< css::xml::sax::XDocumentHandler > xFilter (static_cast< ::cppu::OWeakObject* >(pFilter), css::uno::UNO_QUERY_THROW); // connect parser, filter and stream - css::uno::Reference< css::xml::sax::XParser > xParser(xSMGR->createInstance(SERVICENAME_SAXPARSER), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::xml::sax::XParser > xParser = css::xml::sax::Parser::create(comphelper::getComponentContext(xSMGR)); xParser->setDocumentHandler(xFilter); css::xml::sax::InputSource aSource; diff --git a/framework/source/fwe/helper/configimporter.cxx b/framework/source/fwe/helper/configimporter.cxx index 0aacbdaea457..ca6c1a108c59 100644 --- a/framework/source/fwe/helper/configimporter.cxx +++ b/framework/source/fwe/helper/configimporter.cxx @@ -41,11 +41,10 @@ namespace framework sal_Bool UIConfigurationImporterOOo1x::ImportCustomToolbars( const uno::Reference< ui::XUIConfigurationManager >& rContainerFactory, uno::Sequence< uno::Reference< container::XIndexContainer > >& rSeqContainer, - const uno::Reference< lang::XMultiServiceFactory >& rServiceManager, + const uno::Reference< uno::XComponentContext >& rxContext, const uno::Reference< embed::XStorage >& rToolbarStorage ) { const char USERDEFTOOLBOX[] = "userdeftoolbox0.xml"; - uno::Reference< lang::XMultiServiceFactory > rSrvMgr( rServiceManager ); sal_Bool bResult ( sal_False ); if ( rToolbarStorage.is() && rContainerFactory.is() ) @@ -66,7 +65,7 @@ sal_Bool UIConfigurationImporterOOo1x::ImportCustomToolbars( if ( xInputStream.is() ) { uno::Reference< container::XIndexContainer > xContainer = rContainerFactory->createSettings(); - if ( ToolBoxConfiguration::LoadToolBox( rSrvMgr, xInputStream, xContainer )) + if ( ToolBoxConfiguration::LoadToolBox( rxContext, xInputStream, xContainer )) { sal_uInt32 nIndex = rSeqContainer.getLength(); rSeqContainer.realloc( nIndex+1 ); diff --git a/framework/source/fwe/xml/menuconfiguration.cxx b/framework/source/fwe/xml/menuconfiguration.cxx index fe522fe3de95..c47e52d226aa 100644 --- a/framework/source/fwe/xml/menuconfiguration.cxx +++ b/framework/source/fwe/xml/menuconfiguration.cxx @@ -36,9 +36,10 @@ #include <uielement/rootitemcontainer.hxx> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/frame/XFrame.hpp> +#include <comphelper/processfactory.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -66,7 +67,7 @@ Reference< XIndexAccess > MenuConfiguration::CreateMenuBarConfigurationFromXML( Reference< XInputStream >& rInputStream ) throw ( WrappedTargetException ) { - Reference< XParser > xParser( m_rxServiceManager->createInstance(SERVICENAME_SAXPARSER),UNO_QUERY); + Reference< XParser > xParser = Parser::create( comphelper::getComponentContext(m_rxServiceManager) ); // connect stream to input stream to the parser InputSource aInputSource; diff --git a/framework/source/fwe/xml/statusbarconfiguration.cxx b/framework/source/fwe/xml/statusbarconfiguration.cxx index 17e41e381b4f..2b24554f4485 100644 --- a/framework/source/fwe/xml/statusbarconfiguration.cxx +++ b/framework/source/fwe/xml/statusbarconfiguration.cxx @@ -32,7 +32,7 @@ #include <xml/saxnamespacefilter.hxx> #include <services.h> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -51,10 +51,10 @@ namespace framework { static Reference< XParser > GetSaxParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext ) { - return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); + return Parser::create( xContext ); } static Reference< XDocumentHandler > GetSaxWriter( @@ -65,11 +65,11 @@ static Reference< XDocumentHandler > GetSaxWriter( } sal_Bool StatusBarConfiguration::LoadStatusBar( - const Reference< XMultiServiceFactory >& xServiceFactory, + const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& xInputStream, const Reference< XIndexContainer >& rStatusbarConfiguration ) { - Reference< XParser > xParser( GetSaxParser( xServiceFactory ) ); + Reference< XParser > xParser( GetSaxParser( rxContext ) ); // connect stream to input stream to the parser InputSource aInputSource; diff --git a/framework/source/fwe/xml/toolboxconfiguration.cxx b/framework/source/fwe/xml/toolboxconfiguration.cxx index 13afba4cf8ea..dcc7d48d1c51 100644 --- a/framework/source/fwe/xml/toolboxconfiguration.cxx +++ b/framework/source/fwe/xml/toolboxconfiguration.cxx @@ -32,7 +32,7 @@ #include <xml/saxnamespacefilter.hxx> #include <services.h> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -51,10 +51,10 @@ namespace framework { static Reference< XParser > GetSaxParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) { - return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); + return Parser::create(rxContext); } static Reference< XDocumentHandler > GetSaxWriter( @@ -65,11 +65,11 @@ static Reference< XDocumentHandler > GetSaxWriter( } sal_Bool ToolBoxConfiguration::LoadToolBox( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rToolbarConfiguration ) { - Reference< XParser > xParser( GetSaxParser( xServiceFactory ) ); + Reference< XParser > xParser( GetSaxParser( rxContext ) ); // connect stream to input stream to the parser InputSource aInputSource; diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 54fdc51d5093..3e3b5033290c 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -47,6 +47,7 @@ #include <vcl/svapp.hxx> #include <rtl/ustrbuf.hxx> #include <osl/mutex.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/sequence.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbstreamhelper.hxx> @@ -492,7 +493,7 @@ sal_Bool ImageManagerImpl::implts_loadUserImages( uno::Reference< XInputStream > xInputStream = xStream->getInputStream(); ImageListsDescriptor aUserImageListInfo; - ImagesConfiguration::LoadImages( m_xServiceManager, + ImagesConfiguration::LoadImages( comphelper::getComponentContext(m_xServiceManager), xInputStream, aUserImageListInfo ); if (( aUserImageListInfo.pImageList != 0 ) && diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index 0b9cfce04f1b..2a6b451303c3 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -47,6 +47,7 @@ #include <vcl/svapp.hxx> #include <rtl/ustrbuf.hxx> +#include <comphelper/componentcontext.hxx> #include <comphelper/sequenceashashmap.hxx> //_________________________________________________________________________________________________________________ @@ -338,7 +339,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement try { Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY ); - ToolBoxConfiguration::LoadToolBox( m_xServiceManager, xInputStream, xIndexContainer ); + ToolBoxConfiguration::LoadToolBox( comphelper::getComponentContext(m_xServiceManager), xInputStream, xIndexContainer ); RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer ); aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY ); return; @@ -355,7 +356,7 @@ void ModuleUIConfigurationManager::impl_requestUIElementData( sal_Int16 nElement try { Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY ); - StatusBarConfiguration::LoadStatusBar( m_xServiceManager, xInputStream, xIndexContainer ); + StatusBarConfiguration::LoadStatusBar( comphelper::getComponentContext(m_xServiceManager), xInputStream, xIndexContainer ); RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer ); aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY ); return; diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx b/framework/source/uiconfiguration/uiconfigurationmanager.cxx index 0ce2e54409a4..f19853f0ed0c 100644 --- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/io/XStream.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> +#include <comphelper/componentcontext.hxx> #include <vcl/svapp.hxx> #include <rtl/ustrbuf.hxx> @@ -276,7 +277,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, try { Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY ); - ToolBoxConfiguration::LoadToolBox( m_xServiceManager, xInputStream, xIndexContainer ); + ToolBoxConfiguration::LoadToolBox( comphelper::getComponentContext(m_xServiceManager), xInputStream, xIndexContainer ); RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer ); aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY ); return; @@ -293,7 +294,7 @@ void UIConfigurationManager::impl_requestUIElementData( sal_Int16 nElementType, try { Reference< XIndexContainer > xIndexContainer( static_cast< OWeakObject * >( new RootItemContainer() ), UNO_QUERY ); - StatusBarConfiguration::LoadStatusBar( m_xServiceManager, xInputStream, xIndexContainer ); + StatusBarConfiguration::LoadStatusBar( comphelper::getComponentContext(m_xServiceManager), xInputStream, xIndexContainer ); RootItemContainer* pRootItemContainer = RootItemContainer::GetImplementation( xIndexContainer ); aUIElementData.xSettings = Reference< XIndexAccess >( static_cast< OWeakObject * >( new ConstItemContainer( pRootItemContainer, sal_True ) ), UNO_QUERY ); return; diff --git a/framework/source/xml/imagesconfiguration.cxx b/framework/source/xml/imagesconfiguration.cxx index b583605cec63..622b45f5eecc 100644 --- a/framework/source/xml/imagesconfiguration.cxx +++ b/framework/source/xml/imagesconfiguration.cxx @@ -33,7 +33,7 @@ #include <xml/imagesdocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -51,10 +51,10 @@ namespace framework { static Reference< XParser > GetSaxParser( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) { - return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); + return Parser::create(rxContext); } static Reference< XDocumentHandler > GetSaxWriter( @@ -65,11 +65,11 @@ static Reference< XDocumentHandler > GetSaxWriter( } sal_Bool ImagesConfiguration::LoadImages( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rInputStream, ImageListsDescriptor& rItems ) { - Reference< XParser > xParser( GetSaxParser( xServiceFactory ) ); + Reference< XParser > xParser( GetSaxParser( rxContext ) ); // connect stream to input stream to the parser InputSource aInputSource; |