diff options
Diffstat (limited to 'framework/source/xml')
-rw-r--r-- | framework/source/xml/eventsconfiguration.cxx | 9 | ||||
-rw-r--r-- | framework/source/xml/eventsdocumenthandler.cxx | 13 | ||||
-rw-r--r-- | framework/source/xml/imagesconfiguration.cxx | 9 | ||||
-rw-r--r-- | framework/source/xml/imagesdocumenthandler.cxx | 13 | ||||
-rw-r--r-- | framework/source/xml/menuconfiguration.cxx | 7 | ||||
-rw-r--r-- | framework/source/xml/menudocumenthandler.cxx | 27 | ||||
-rw-r--r-- | framework/source/xml/saxnamespacefilter.cxx | 16 | ||||
-rw-r--r-- | framework/source/xml/statusbarconfiguration.cxx | 5 | ||||
-rw-r--r-- | framework/source/xml/statusbardocumenthandler.cxx | 23 | ||||
-rw-r--r-- | framework/source/xml/toolboxconfiguration.cxx | 5 | ||||
-rw-r--r-- | framework/source/xml/toolboxdocumenthandler.cxx | 26 |
11 files changed, 40 insertions, 113 deletions
diff --git a/framework/source/xml/eventsconfiguration.cxx b/framework/source/xml/eventsconfiguration.cxx index 0ff9665bcc..320f94b8a6 100644 --- a/framework/source/xml/eventsconfiguration.cxx +++ b/framework/source/xml/eventsconfiguration.cxx @@ -32,6 +32,7 @@ #include "precompiled_framework.hxx" #include <xml/eventsconfiguration.hxx> #include <xml/eventsdocumenthandler.hxx> +#include <services.h> #ifndef __FRAMEWORK_XML_SAXNAMESPACEFILTER_HXX_ #include <xml/saxnamespacefilter.hxx> @@ -74,8 +75,8 @@ static Reference< XParser > GetSaxParser( ) { //Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - //return Reference< XParser >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY); - return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY); + //return Reference< XParser >( xServiceManager->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); + return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); } static Reference< XDocumentHandler > GetSaxWriter( @@ -84,8 +85,8 @@ static Reference< XDocumentHandler > GetSaxWriter( ) { //Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - //return Reference< XDocumentHandler >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; - return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; + //return Reference< XDocumentHandler >( xServiceManager->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ; + return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ; } // #110897# diff --git a/framework/source/xml/eventsdocumenthandler.cxx b/framework/source/xml/eventsdocumenthandler.cxx index 24764bc7ab..f160ffe895 100644 --- a/framework/source/xml/eventsdocumenthandler.cxx +++ b/framework/source/xml/eventsdocumenthandler.cxx @@ -128,7 +128,6 @@ static EventEntryProperty EventEntries[OReadEventsDocumentHandler::EV_XML_ENTRY_ OReadEventsDocumentHandler::OReadEventsDocumentHandler( EventsConfig& aItems ) : ThreadHelpBase( &Application::GetSolarMutex() ), - ::cppu::OWeakObject(), m_aEventItems( aItems ) { ::rtl::OUString aNamespaceEvent( RTL_CONSTASCII_USTRINGPARAM( XMLNS_EVENT )); @@ -163,18 +162,6 @@ OReadEventsDocumentHandler::~OReadEventsDocumentHandler() { } -Any SAL_CALL OReadEventsDocumentHandler::queryInterface( const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - // XDocumentHandler void SAL_CALL OReadEventsDocumentHandler::startDocument(void) throw ( SAXException, RuntimeException ) diff --git a/framework/source/xml/imagesconfiguration.cxx b/framework/source/xml/imagesconfiguration.cxx index 7fd4050245..995da41240 100644 --- a/framework/source/xml/imagesconfiguration.cxx +++ b/framework/source/xml/imagesconfiguration.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_framework.hxx" #include <xml/imagesconfiguration.hxx> +#include <services.h> #ifndef __FRAMEWORK_CLASSES_IMAGESDOCUMENTHANDLER_HXX_ #include <xml/imagesdocumenthandler.hxx> @@ -78,8 +79,8 @@ static Reference< XParser > GetSaxParser( ) { //Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - //return Reference< XParser >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY); - return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY); + //return Reference< XParser >( xServiceManager->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); + return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); } static Reference< XDocumentHandler > GetSaxWriter( @@ -88,8 +89,8 @@ static Reference< XDocumentHandler > GetSaxWriter( ) { //Reference< XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); - //return Reference< XDocumentHandler >( xServiceManager->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; - return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; + //return Reference< XDocumentHandler >( xServiceManager->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ; + return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ; } // #110897# diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx index b4906785bc..ceb187c322 100644 --- a/framework/source/xml/imagesdocumenthandler.cxx +++ b/framework/source/xml/imagesdocumenthandler.cxx @@ -134,7 +134,6 @@ ImageXMLEntryProperty ImagesEntries[OReadImagesDocumentHandler::IMG_XML_ENTRY_CO OReadImagesDocumentHandler::OReadImagesDocumentHandler( ImageListsDescriptor& aItems ) : ThreadHelpBase( &Application::GetSolarMutex() ), - ::cppu::OWeakObject(), m_aImageList( aItems ), m_pImages( 0 ), m_pExternalImages( 0 ) @@ -175,18 +174,6 @@ OReadImagesDocumentHandler::~OReadImagesDocumentHandler() { } -Any SAL_CALL OReadImagesDocumentHandler::queryInterface( const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - // XDocumentHandler void SAL_CALL OReadImagesDocumentHandler::startDocument(void) throw ( SAXException, RuntimeException ) diff --git a/framework/source/xml/menuconfiguration.cxx b/framework/source/xml/menuconfiguration.cxx index 602c2ffcb3..7dbe62e38a 100644 --- a/framework/source/xml/menuconfiguration.cxx +++ b/framework/source/xml/menuconfiguration.cxx @@ -42,6 +42,7 @@ #include <classes/addonmenu.hxx> #include <xml/menudocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> +#include <services.h> #ifndef _FRAMEWORK_SERVICES_LAYOUTMANAGER_HXX_ #include <services/layoutmanager.hxx> @@ -99,9 +100,7 @@ Reference< XIndexAccess > MenuConfiguration::CreateMenuBarConfigurationFromXML( Reference< XInputStream >& rInputStream ) throw ( WrappedTargetException ) { - Reference< XParser > xParser( m_rxServiceManager->createInstance( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" ))), - UNO_QUERY); + Reference< XParser > xParser( m_rxServiceManager->createInstance(SERVICENAME_SAXPARSER),UNO_QUERY); // connect stream to input stream to the parser InputSource aInputSource; @@ -167,7 +166,7 @@ throw ( WrappedTargetException ) Reference< XDocumentHandler > xWriter; xWriter = Reference< XDocumentHandler >( m_rxServiceManager->createInstance( - ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; + SERVICENAME_SAXWRITER), UNO_QUERY) ; Reference< XActiveDataSource> xDataSource( xWriter , UNO_QUERY ); xDataSource->setOutputStream( rOutputStream ); diff --git a/framework/source/xml/menudocumenthandler.cxx b/framework/source/xml/menudocumenthandler.cxx index 7b447572d8..66addd1274 100644 --- a/framework/source/xml/menudocumenthandler.cxx +++ b/framework/source/xml/menudocumenthandler.cxx @@ -47,7 +47,6 @@ #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/ui/ItemType.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -55,7 +54,7 @@ // other includes //_________________________________________________________________________________________________________________ #include <comphelper/processfactory.hxx> - +#include <rtl/logfile.hxx> #include <comphelper/attributelist.hxx> //_________________________________________________________________________________________________________________ @@ -174,19 +173,6 @@ ReadMenuDocumentHandlerBase::~ReadMenuDocumentHandlerBase() { } -Any SAL_CALL ReadMenuDocumentHandlerBase::queryInterface( - const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - void SAL_CALL ReadMenuDocumentHandlerBase::ignorableWhitespace( const ::rtl::OUString& ) throw( SAXException, RuntimeException ) @@ -607,14 +593,15 @@ throw( SAXException, RuntimeException ) m_bMenuMode = sal_True; // Container must be factory to create sub container - Reference< XComponentContext > xComponentContext; - Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY ); - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= - xComponentContext; + if ( !m_xComponentContext.is() ) + { + const Reference< XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); + m_xComponentContext.set(xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))), UNO_QUERY_THROW ); + } Reference< XIndexContainer > xSubItemContainer; if ( m_xContainerFactory.is() ) - xSubItemContainer = Reference< XIndexContainer >( m_xContainerFactory->createInstanceWithContext( xComponentContext ), UNO_QUERY ); + xSubItemContainer = Reference< XIndexContainer >( m_xContainerFactory->createInstanceWithContext( m_xComponentContext ), UNO_QUERY ); // read attributes for menu for ( sal_Int16 i=0; i< xAttrList->getLength(); i++ ) diff --git a/framework/source/xml/saxnamespacefilter.cxx b/framework/source/xml/saxnamespacefilter.cxx index 47040e63ad..06ba54932b 100644 --- a/framework/source/xml/saxnamespacefilter.cxx +++ b/framework/source/xml/saxnamespacefilter.cxx @@ -43,6 +43,7 @@ #include <comphelper/attributelist.hxx> #include <vcl/svapp.hxx> +#include <rtl/logfile.hxx> using namespace ::com::sun::star::xml::sax; using namespace ::com::sun::star::uno; @@ -54,7 +55,7 @@ namespace framework{ SaxNamespaceFilter::SaxNamespaceFilter( Reference< XDocumentHandler >& rSax1DocumentHandler ) : - ThreadHelpBase( &Application::GetSolarMutex() ), OWeakObject(), + ThreadHelpBase( &Application::GetSolarMutex() ), m_xLocator( 0 ), xDocumentHandler( rSax1DocumentHandler ), m_nDepth( 0 ) @@ -65,17 +66,6 @@ SaxNamespaceFilter::~SaxNamespaceFilter() { } -Any SAL_CALL SaxNamespaceFilter::queryInterface( const Type & rType ) throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - // XDocumentHandler void SAL_CALL SaxNamespaceFilter::startDocument(void) throw ( SAXException, RuntimeException ) @@ -92,7 +82,7 @@ void SAL_CALL SaxNamespaceFilter::startElement( throw( SAXException, RuntimeException ) { XMLNamespaces aXMLNamespaces; - if ( m_aNamespaceStack.size() > 0 ) + if ( !m_aNamespaceStack.empty() ) aXMLNamespaces = m_aNamespaceStack.top(); ::comphelper::AttributeList* pNewList = new ::comphelper::AttributeList(); diff --git a/framework/source/xml/statusbarconfiguration.cxx b/framework/source/xml/statusbarconfiguration.cxx index 23c42c884e..618afd6796 100644 --- a/framework/source/xml/statusbarconfiguration.cxx +++ b/framework/source/xml/statusbarconfiguration.cxx @@ -34,6 +34,7 @@ #include <xml/statusbarconfiguration.hxx> #include <xml/statusbardocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> +#include <services.h> //_________________________________________________________________________________________________________________ // interface includes @@ -73,14 +74,14 @@ static Reference< XParser > GetSaxParser( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ) { - return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY); + return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); } static Reference< XDocumentHandler > GetSaxWriter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ) { - return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; + return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ; } sal_Bool StatusBarConfiguration::LoadStatusBar( diff --git a/framework/source/xml/statusbardocumenthandler.cxx b/framework/source/xml/statusbardocumenthandler.cxx index cebb852d79..321239d03c 100644 --- a/framework/source/xml/statusbardocumenthandler.cxx +++ b/framework/source/xml/statusbardocumenthandler.cxx @@ -179,7 +179,6 @@ StatusBarEntryProperty StatusBarEntries[OReadStatusBarDocumentHandler::SB_XML_EN OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler( const Reference< XIndexContainer >& rStatusBarItems ) : ThreadHelpBase( &Application::GetSolarMutex() ), - ::cppu::OWeakObject(), m_aStatusBarItems( rStatusBarItems ) { ::rtl::OUString aNamespaceStatusBar( RTL_CONSTASCII_USTRINGPARAM( XMLNS_STATUSBAR )); @@ -214,18 +213,6 @@ OReadStatusBarDocumentHandler::~OReadStatusBarDocumentHandler() { } -Any SAL_CALL OReadStatusBarDocumentHandler::queryInterface( const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - // XDocumentHandler void SAL_CALL OReadStatusBarDocumentHandler::startDocument(void) throw ( SAXException, RuntimeException ) @@ -428,11 +415,11 @@ throw( SAXException, RuntimeException ) aStatusbarItemProp[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_WIDTH )); aStatusbarItemProp[5].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )); - aStatusbarItemProp[0].Value = makeAny( aCommandURL ); - aStatusbarItemProp[1].Value = makeAny( aHelpURL ); - aStatusbarItemProp[2].Value = makeAny( nOffset ); - aStatusbarItemProp[3].Value = makeAny( nItemBits ); - aStatusbarItemProp[4].Value = makeAny( nWidth ); + aStatusbarItemProp[0].Value <<= aCommandURL; + aStatusbarItemProp[1].Value <<= aHelpURL; + aStatusbarItemProp[2].Value <<= nOffset; + aStatusbarItemProp[3].Value <<= nItemBits; + aStatusbarItemProp[4].Value <<= nWidth; aStatusbarItemProp[5].Value = makeAny( ::com::sun::star::ui::ItemType::DEFAULT ); m_aStatusBarItems->insertByIndex( m_aStatusBarItems->getCount(), makeAny( aStatusbarItemProp ) ); diff --git a/framework/source/xml/toolboxconfiguration.cxx b/framework/source/xml/toolboxconfiguration.cxx index b165ec89f1..24c1e8840f 100644 --- a/framework/source/xml/toolboxconfiguration.cxx +++ b/framework/source/xml/toolboxconfiguration.cxx @@ -35,6 +35,7 @@ #include <xml/toolboxdocumenthandler.hxx> #include <xml/toolboxlayoutdocumenthandler.hxx> #include <xml/saxnamespacefilter.hxx> +#include <services.h> //_________________________________________________________________________________________________________________ // interface includes @@ -73,7 +74,7 @@ static Reference< XParser > GetSaxParser( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ) { - return Reference< XParser >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )), UNO_QUERY); + return Reference< XParser >( xServiceFactory->createInstance( SERVICENAME_SAXPARSER), UNO_QUERY); } static Reference< XDocumentHandler > GetSaxWriter( @@ -81,7 +82,7 @@ static Reference< XDocumentHandler > GetSaxWriter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory ) { - return Reference< XDocumentHandler >( xServiceFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ; + return Reference< XDocumentHandler >( xServiceFactory->createInstance( SERVICENAME_SAXWRITER), UNO_QUERY) ; } // #110897# diff --git a/framework/source/xml/toolboxdocumenthandler.cxx b/framework/source/xml/toolboxdocumenthandler.cxx index e48dd41a37..53098b1687 100644 --- a/framework/source/xml/toolboxdocumenthandler.cxx +++ b/framework/source/xml/toolboxdocumenthandler.cxx @@ -140,7 +140,6 @@ ToolBarEntryProperty ToolBoxEntries[OReadToolBoxDocumentHandler::TB_XML_ENTRY_CO OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XIndexContainer >& rItemContainer ) : ThreadHelpBase( &Application::GetSolarMutex() ), - ::cppu::OWeakObject(), m_rItemContainer( rItemContainer ), m_aType( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_TYPE )), m_aLabel( RTL_CONSTASCII_USTRINGPARAM( ITEM_DESCRIPTOR_LABEL )), @@ -193,18 +192,6 @@ OReadToolBoxDocumentHandler::~OReadToolBoxDocumentHandler() { } -Any SAL_CALL OReadToolBoxDocumentHandler::queryInterface( const Type & rType ) -throw( RuntimeException ) -{ - Any a = ::cppu::queryInterface( - rType , - SAL_STATIC_CAST( XDocumentHandler*, this )); - if ( a.hasValue() ) - return a; - - return OWeakObject::queryInterface( rType ); -} - // XDocumentHandler void SAL_CALL OReadToolBoxDocumentHandler::startDocument(void) throw ( SAXException, RuntimeException ) @@ -435,12 +422,12 @@ throw( SAXException, RuntimeException ) aToolbarItemProp[4].Name = m_aStyle; aToolbarItemProp[5].Name = m_aIsVisible; - aToolbarItemProp[0].Value = makeAny( aCommandURL ); - aToolbarItemProp[1].Value = makeAny( aHelpURL ); - aToolbarItemProp[2].Value = makeAny( aLabel ); + aToolbarItemProp[0].Value <<= aCommandURL; + aToolbarItemProp[1].Value <<= aHelpURL; + aToolbarItemProp[2].Value <<= aLabel; aToolbarItemProp[3].Value = makeAny( ::com::sun::star::ui::ItemType::DEFAULT ); - aToolbarItemProp[4].Value = makeAny( nItemBits ); - aToolbarItemProp[5].Value = makeAny( bVisible ); + aToolbarItemProp[4].Value <<= nItemBits; + aToolbarItemProp[5].Value <<= bVisible; m_rItemContainer->insertByIndex( m_rItemContainer->getCount(), makeAny( aToolbarItemProp ) ); } @@ -693,8 +680,7 @@ void OWriteToolBoxDocumentHandler::WriteToolBoxDocument() throw { try { - Any a = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))); - a >>= aUIName; + xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))) >>= aUIName; } catch ( UnknownPropertyException& ) { |