Kaydet (Commit) 93ef9a43 authored tarafından Alexandre Vicenzi's avatar Alexandre Vicenzi Kaydeden (comit) Marcos Souza

fdo#54938 Convert bridges, editeng and others to cppu::supportsService

Change-Id: I7ff5189473c3e0831c2f1e95264d1a04f3b716a9
Reviewed-on: https://gerrit.libreoffice.org/7761Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
Tested-by: 's avatarMarcos Souza <marcos.souza.org@gmail.com>
üst 434ca1af
......@@ -20,22 +20,15 @@
#include <string.h>
#include <stdlib.h>
#include <osl/time.h>
#include <uno/threadpool.h>
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <test/XTestFactory.hpp>
#include <cppuhelper/servicefactory.hxx>
#include <com/sun/star/bridge/XInstanceProvider.hpp>
#include <com/sun/star/registry/XImplementationRegistration.hpp>
#include <com/sun/star/test/performance/XPerformanceTest.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/weak.hxx>
using namespace ::test;
......@@ -249,35 +242,28 @@ public:
{ throw _aDummyRE; }
};
void ServiceImpl::async() throw(::com::sun::star::uno::RuntimeException)
{}
// XServiceInfo
//__________________________________________________________________________________________________
OUString ServiceImpl::getImplementationName()
throw (RuntimeException)
{
return OUString( );
}
//__________________________________________________________________________________________________
sal_Bool ServiceImpl::supportsService( const OUString & /* rServiceName */)
throw (RuntimeException)
{
return sal_False;
}
//__________________________________________________________________________________________________
Sequence< OUString > ServiceImpl::getSupportedServiceNames()
throw (RuntimeException)
{
return Sequence< OUString > ();
}
/******************
* OCallMe
*
*****************/
Any OCallMe::queryInterface( const Type & aType ) throw ( RuntimeException )
{
Any a = ::cppu::queryInterface( aType,
......@@ -368,10 +354,6 @@ void OCallMe::callAgain( const Reference< ::test::XCallMe >& callAgainArg,
}
}
/********************
* OInterfaceTest
*
*******************/
Any OInterfaceTest::queryInterface( const Type & aType ) throw ( RuntimeException )
{
Any a = ::cppu::queryInterface( aType,
......@@ -383,7 +365,6 @@ Any OInterfaceTest::queryInterface( const Type & aType ) throw ( RuntimeExcepti
return OWeakObject::queryInterface( aType );
}
void OInterfaceTest::setIn(
const Reference< ::test::XCallMe >& callback )
throw(RuntimeException)
......@@ -401,7 +382,6 @@ void OInterfaceTest::setInOut( Reference< ::test::XCallMe >& callback )
call();
}
void OInterfaceTest::getOut( Reference< ::test::XCallMe >& callback )
throw(RuntimeException)
{
......@@ -423,7 +403,6 @@ void OInterfaceTest::call()
}
}
Any OTestFactory::queryInterface( const Type & aType ) throw ( RuntimeException )
{
Any a = ::cppu::queryInterface( aType,
......@@ -449,9 +428,6 @@ Reference< ::test::XInterfaceTest > SAL_CALL OTestFactory::createInterfaceTest(
return Reference < XInterfaceTest > ( (XInterfaceTest * ) new OInterfaceTest() );
}
// class OInstanceProvider :
// public ::cppu::OWeakObject,
// public XInstanceProvider
......@@ -472,13 +448,6 @@ Reference< ::test::XInterfaceTest > SAL_CALL OTestFactory::createInterfaceTest(
// ::com::sun::star::uno::RuntimeException);
// };
double getCallsPerSec( const Reference < XCallMe > &rCall , int nLoops, int nToDo )
{
TimeValue aStartTime, aEndTime;
......@@ -742,11 +711,6 @@ void testRemote( const Reference< XInterface > &rRemote )
}
Reference <XInterface > createComponent( const OUString &sService ,
const OUString &sDllName,
const Reference < XMultiServiceFactory > &rSMgr )
......@@ -782,5 +746,4 @@ Reference <XInterface > createComponent( const OUString &sService ,
return rInterface;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -19,7 +19,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/awt/XBitmap.hpp>
#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
#include <vcl/graph.hxx>
......@@ -79,10 +79,6 @@ unsigned short ConvertUnoAdjust( SvxAdjust eAdjust )
return aSvxToUnoAdjust[eAdjust];
}
/******************************************************************
* SvxUnoNumberingRules
******************************************************************/
UNO3_GETIMPLEMENTATION_IMPL( SvxUnoNumberingRules );
SvxUnoNumberingRules::SvxUnoNumberingRules( const SvxNumRule& rRule ) throw()
......@@ -163,7 +159,7 @@ OUString SAL_CALL SvxUnoNumberingRules::getImplementationName( ) throw(RuntimeE
sal_Bool SAL_CALL SvxUnoNumberingRules::supportsService( const OUString& ServiceName ) throw(RuntimeException)
{
return ServiceName == pSvxUnoNumberingRulesService;
return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL SvxUnoNumberingRules::getSupportedServiceNames( ) throw(RuntimeException)
......@@ -472,8 +468,6 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex( const Sequence< beans::Prope
maRule.SetLevel( (sal_uInt16)nIndex, aFmt );
}
///////////////////////////////////////////////////////////////////////
const SvxNumRule& SvxGetNumRule( Reference< XIndexReplace > xRule ) throw( IllegalArgumentException )
{
SvxUnoNumberingRules* pRule = SvxUnoNumberingRules::getImplementation( xRule );
......@@ -497,9 +491,6 @@ com::sun::star::uno::Reference< com::sun::star::container::XIndexReplace > SvxCr
}
}
///////////////////////////////////////////////////////////////////////
class SvxUnoNumberingRulesCompare : public ::cppu::WeakAggImplHelper1< XAnyCompare >
{
public:
......
......@@ -18,36 +18,19 @@
*/
//------------------------------------------------------------------------
//
// Global header
//
//------------------------------------------------------------------------
#include <osl/mutex.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/servicehelper.hxx>
//------------------------------------------------------------------------
//
// Project-local header
//
//------------------------------------------------------------------------
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weakref.hxx>
#include <editeng/unopracc.hxx>
#include <editeng/unoedsrc.hxx>
#include <osl/mutex.hxx>
using namespace ::com::sun::star;
//------------------------------------------------------------------------
//
// SvxAccessibleTextPropertySet implementation
//
//------------------------------------------------------------------------
SvxAccessibleTextPropertySet::SvxAccessibleTextPropertySet( const SvxEditSource* pEditSrc, const SvxItemPropertySet* pPropSet )
: SvxUnoTextRangeBase( pEditSrc, pPropSet )
......@@ -136,14 +119,7 @@ OUString SAL_CALL SAL_CALL SvxAccessibleTextPropertySet::getImplementationName (
sal_Bool SAL_CALL SvxAccessibleTextPropertySet::supportsService (const OUString& sServiceName) throw (uno::RuntimeException)
{
// Iterate over all supported service names and return true if on of them
// matches the given name.
uno::Sequence< OUString> aSupportedServices (
getSupportedServiceNames ());
for (int i=0; i<aSupportedServices.getLength(); i++)
if (sServiceName == aSupportedServices[i])
return sal_True;
return sal_False;
return cppu::supportsService(this, sServiceName);
}
uno::Sequence< OUString> SAL_CALL SvxAccessibleTextPropertySet::getSupportedServiceNames (void) throw (uno::RuntimeException)
......
......@@ -31,16 +31,17 @@
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <cppuhelper/implbase2.hxx>
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XActiveDataControl.hpp>
#include <com/sun/star/io/XStreamListener.hpp>
#include <com/sun/star/document/XExtendedFilterDetection.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/implbase4.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
using namespace ::rtl;
using namespace ::cppu;
......@@ -258,14 +259,7 @@ OUString HwpImportFilter::getImplementationName() throw(::com::sun::star::uno::R
sal_Bool HwpImportFilter::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException)
{
Sequence< OUString > aSNL = getSupportedServiceNames();
const OUString *pArray = aSNL.getConstArray();
for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
if ( pArray[i] == ServiceName )
return sal_True;
return sal_False;
return cppu::supportsService(this, ServiceName);
}
//XExtendedFilterDetection
......
......@@ -17,31 +17,31 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/useroptions.hxx>
#include <unotools/lingucfg.hxx>
#include <rtl/instance.hxx>
#include <cppuhelper/factory.hxx>
#include <unotools/localfilehelper.hxx>
#include <com/sun/star/linguistic2/XConversionDictionaryList.hpp>
#include <com/sun/star/linguistic2/XConversionDictionary.hpp>
#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
#include <com/sun/star/util/XFlushable.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/linguistic2/ConversionDictionaryType.hpp>
#include <com/sun/star/linguistic2/XConversionDictionary.hpp>
#include <com/sun/star/linguistic2/XConversionDictionaryList.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/util/XFlushable.hpp>
#include <cppuhelper/factory.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <rtl/instance.hxx>
#include <tools/stream.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/localfilehelper.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/useroptions.hxx>
#include "convdiclist.hxx"
#include "convdic.hxx"
#include "convdiclist.hxx"
#include "defs.hxx"
#include "hhconvdic.hxx"
#include "linguistic/misc.hxx"
#include "defs.hxx"
using namespace osl;
using namespace com::sun::star;
......@@ -51,11 +51,8 @@ using namespace com::sun::star::container;
using namespace com::sun::star::linguistic2;
using namespace linguistic;
#define SN_CONV_DICTIONARY_LIST "com.sun.star.linguistic2.ConversionDictionaryList"
bool operator == ( const Locale &r1, const Locale &r2 )
{
return r1.Language == r2.Language &&
......@@ -63,7 +60,6 @@ bool operator == ( const Locale &r1, const Locale &r2 )
r1.Variant == r2.Variant;
}
OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectoryURL )
{
// build URL to use for new (persistent) dictionaries
......@@ -81,7 +77,6 @@ OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectory
return aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI );
}
class ConvDicNameContainer :
public cppu::WeakImplHelper1
<
......@@ -117,7 +112,6 @@ public:
virtual void SAL_CALL insertByName( const OUString& aName, const ::com::sun::star::uno::Any& 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( const OUString& Name ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
// looks for conversion dictionaries with the specified extension
// in the directory and adds them to the container
void AddConvDics( const OUString &rSearchDirPathURL, const OUString &rExtension );
......@@ -134,18 +128,15 @@ public:
}
};
ConvDicNameContainer::ConvDicNameContainer( ConvDicList &rMyConvDicList ) :
rConvDicList( rMyConvDicList )
{
}
ConvDicNameContainer::~ConvDicNameContainer()
{
}
void ConvDicNameContainer::FlushDics() const
{
sal_Int32 nLen = aConvDics.getLength();
......@@ -167,7 +158,6 @@ void ConvDicNameContainer::FlushDics() const
}
}
sal_Int32 ConvDicNameContainer::GetIndexByName_Impl(
const OUString& rName )
{
......@@ -182,7 +172,6 @@ sal_Int32 ConvDicNameContainer::GetIndexByName_Impl(
return nRes;
}
uno::Reference< XConversionDictionary > ConvDicNameContainer::GetByName(
const OUString& rName )
{
......@@ -193,7 +182,6 @@ uno::Reference< XConversionDictionary > ConvDicNameContainer::GetByName(
return xRes;
}
uno::Type SAL_CALL ConvDicNameContainer::getElementType( )
throw (RuntimeException)
{
......@@ -201,7 +189,6 @@ uno::Type SAL_CALL ConvDicNameContainer::getElementType( )
return uno::Type( ::getCppuType( (uno::Reference< XConversionDictionary > *) 0) );
}
sal_Bool SAL_CALL ConvDicNameContainer::hasElements( )
throw (RuntimeException)
{
......@@ -209,7 +196,6 @@ sal_Bool SAL_CALL ConvDicNameContainer::hasElements( )
return aConvDics.getLength() > 0;
}
uno::Any SAL_CALL ConvDicNameContainer::getByName( const OUString& rName )
throw (NoSuchElementException, WrappedTargetException, RuntimeException)
{
......@@ -220,7 +206,6 @@ uno::Any SAL_CALL ConvDicNameContainer::getByName( const OUString& rName )
return makeAny( xRes );
}
uno::Sequence< OUString > SAL_CALL ConvDicNameContainer::getElementNames( )
throw (RuntimeException)
{
......@@ -235,7 +220,6 @@ uno::Sequence< OUString > SAL_CALL ConvDicNameContainer::getElementNames( )
return aRes;
}
sal_Bool SAL_CALL ConvDicNameContainer::hasByName( const OUString& rName )
throw (RuntimeException)
{
......@@ -243,7 +227,6 @@ sal_Bool SAL_CALL ConvDicNameContainer::hasByName( const OUString& rName )
return GetByName( rName ).is();
}
void SAL_CALL ConvDicNameContainer::replaceByName(
const OUString& rName,
const uno::Any& rElement )
......@@ -261,7 +244,6 @@ void SAL_CALL ConvDicNameContainer::replaceByName(
aConvDics.getArray()[ nRplcIdx ] = xNew;
}
void SAL_CALL ConvDicNameContainer::insertByName(
const OUString& rName,
const Any& rElement )
......@@ -281,7 +263,6 @@ void SAL_CALL ConvDicNameContainer::insertByName(
aConvDics.getArray()[ nLen ] = xNew;
}
void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName )
throw (NoSuchElementException, WrappedTargetException, RuntimeException)
{
......@@ -323,7 +304,6 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName )
aConvDics.realloc( nLen - 1 );
}
void ConvDicNameContainer::AddConvDics(
const OUString &rSearchDirPathURL,
const OUString &rExtension )
......@@ -375,7 +355,6 @@ void ConvDicNameContainer::AddConvDics(
}
}
namespace
{
struct StaticConvDicList : public rtl::StaticWithInit<
......@@ -386,7 +365,6 @@ namespace
};
}
void ConvDicList::MyAppExitListener::AtExit()
{
rMyDicList.FlushDics();
......@@ -404,7 +382,6 @@ ConvDicList::ConvDicList() :
pExitListener->Activate();
}
ConvDicList::~ConvDicList()
{
......@@ -414,7 +391,6 @@ ConvDicList::~ConvDicList()
pExitListener->Deactivate();
}
void ConvDicList::FlushDics()
{
// check only pointer to avoid creating the container when
......@@ -423,7 +399,6 @@ void ConvDicList::FlushDics()
pNameContainer->FlushDics();
}
ConvDicNameContainer & ConvDicList::GetNameContainer()
{
if (!pNameContainer)
......@@ -460,7 +435,6 @@ ConvDicNameContainer & ConvDicList::GetNameContainer()
return *pNameContainer;
}
uno::Reference< container::XNameContainer > SAL_CALL ConvDicList::getDictionaryContainer( ) throw (RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
......@@ -469,7 +443,6 @@ uno::Reference< container::XNameContainer > SAL_CALL ConvDicList::getDictionaryC
return xNameContainer;
}
uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary(
const OUString& rName,
const Locale& rLocale,
......@@ -508,7 +481,6 @@ uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary(
return xRes;
}
uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions(
const OUString& rText,
sal_Int32 nStartPos,
......@@ -561,7 +533,6 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions(
return aRes;
}
sal_Int16 SAL_CALL ConvDicList::queryMaxCharCount(
const Locale& rLocale,
sal_Int16 nConversionDictionaryType,
......@@ -588,7 +559,6 @@ sal_Int16 SAL_CALL ConvDicList::queryMaxCharCount(
return nRes;
}
void SAL_CALL ConvDicList::dispose( )
throw (RuntimeException)
{
......@@ -603,7 +573,6 @@ void SAL_CALL ConvDicList::dispose( )
}
}
void SAL_CALL ConvDicList::addEventListener(
const uno::Reference< XEventListener >& rxListener )
throw (RuntimeException)
......@@ -613,7 +582,6 @@ void SAL_CALL ConvDicList::addEventListener(
aEvtListeners.addInterface( rxListener );
}
void SAL_CALL ConvDicList::removeEventListener(
const uno::Reference< XEventListener >& rxListener )
throw (RuntimeException)
......@@ -623,31 +591,26 @@ void SAL_CALL ConvDicList::removeEventListener(
aEvtListeners.removeInterface( rxListener );
}
OUString SAL_CALL ConvDicList::getImplementationName( )
OUString SAL_CALL ConvDicList::getImplementationName()
throw (RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
return getImplementationName_Static();
}
sal_Bool SAL_CALL ConvDicList::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
return rServiceName == SN_CONV_DICTIONARY_LIST;
return cppu::supportsService(this, rServiceName);
}
uno::Sequence< OUString > SAL_CALL ConvDicList::getSupportedServiceNames( )
uno::Sequence< OUString > SAL_CALL ConvDicList::getSupportedServiceNames()
throw (RuntimeException)
{
MutexGuard aGuard( GetLinguMutex() );
return getSupportedServiceNames_Static();
}
uno::Sequence< OUString > ConvDicList::getSupportedServiceNames_Static()
throw()
{
......@@ -656,8 +619,6 @@ uno::Sequence< OUString > ConvDicList::getSupportedServiceNames_Static()
return aSNS;
}
uno::Reference< uno::XInterface > SAL_CALL ConvDicList_CreateInstance(
const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ )
throw(Exception)
......@@ -685,5 +646,4 @@ void * SAL_CALL ConvDicList_getFactory(
return pRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -17,27 +17,24 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <osl/diagnose.h>
#include <sal/macros.h>
#include <rtl/tencinfo.h>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <comphelper/processfactory.hxx>
#include <xmloff/attrlist.hxx>
#include <ucbhelper/content.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
#include <rtl/tencinfo.h>
#include <sal/macros.h>
#include <tools/stream.hxx>
#include "LotusWordProImportFilter.hxx"
#include <vector>
#include <ucbhelper/content.hxx>
#include <xmloff/attrlist.hxx>
#include "LotusWordProImportFilter.hxx"
#include "lwpfilter.hxx"
using namespace com::sun::star;
......@@ -327,7 +324,6 @@ OUString SAL_CALL LotusWordProImportFilter::detect( com::sun::star::uno::Sequenc
return sTypeName;
}
// XInitialization
void SAL_CALL LotusWordProImportFilter::initialize( const Sequence< Any >& aArguments )
throw (Exception, RuntimeException)
......@@ -348,6 +344,7 @@ void SAL_CALL LotusWordProImportFilter::initialize( const Sequence< Any >& aArgu
}
}
}
OUString LotusWordProImportFilter_getImplementationName ()
throw (RuntimeException)
{
......@@ -356,11 +353,7 @@ OUString LotusWordProImportFilter_getImplementationName ()
#define SERVICE_NAME1 "com.sun.star.document.ImportFilter"
#define SERVICE_NAME2 "com.sun.star.document.ExtendedTypeDetection"
sal_Bool SAL_CALL LotusWordProImportFilter_supportsService( const OUString& ServiceName )
throw (RuntimeException)
{
return ServiceName == SERVICE_NAME1 || ServiceName == SERVICE_NAME2;
}
Sequence< OUString > SAL_CALL LotusWordProImportFilter_getSupportedServiceNames( )
throw (RuntimeException)
{
......@@ -370,6 +363,7 @@ Sequence< OUString > SAL_CALL LotusWordProImportFilter_getSupportedServiceNames(
pArray[1] = OUString ( SERVICE_NAME2 );
return aRet;
}
#undef SERVICE_NAME2
#undef SERVICE_NAME1
......@@ -388,7 +382,7 @@ OUString SAL_CALL LotusWordProImportFilter::getImplementationName( )
sal_Bool SAL_CALL LotusWordProImportFilter::supportsService( const OUString& rServiceName )
throw (RuntimeException)
{
return LotusWordProImportFilter_supportsService( rServiceName );
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL LotusWordProImportFilter::getSupportedServiceNames( )
throw (RuntimeException)
......
......@@ -17,11 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weakref.hxx>
#include "MasterScriptProviderFactory.hxx"
......@@ -42,12 +43,6 @@ MasterScriptProviderFactory::~MasterScriptProviderFactory()
{
}
//############################################################################
// Implementation of XScriptProviderFactory
//############################################################################
Reference< provider::XScriptProvider > SAL_CALL
MasterScriptProviderFactory::createScriptProvider( const Any& context ) throw ( lang::IllegalArgumentException, RuntimeException)
{
......@@ -55,10 +50,6 @@ MasterScriptProviderFactory::createScriptProvider( const Any& context ) throw (
return xMsp;
}
//############################################################################
// Helper methods
//############################################################################
const rtl::Reference< ActiveMSPList > &
MasterScriptProviderFactory::getActiveMSPList() const
{
......@@ -71,12 +62,7 @@ MasterScriptProviderFactory::getActiveMSPList() const
return m_MSPList;
}
//############################################################################
// Namespace global methods for setting up MasterScriptProviderFactory service
//############################################################################
Sequence< OUString > SAL_CALL
mspf_getSupportedServiceNames( )
Sequence< OUString > SAL_CALL mspf_getSupportedServiceNames( )
SAL_THROW(())
{
OUString str_name(
......@@ -85,8 +71,7 @@ mspf_getSupportedServiceNames( )
return Sequence< OUString >( &str_name, 1 );
}
OUString SAL_CALL
mspf_getImplementationName( )
OUString SAL_CALL mspf_getImplementationName( )
SAL_THROW(())
{
return OUString(
......@@ -101,19 +86,13 @@ mspf_create( Reference< XComponentContext > const & xComponentContext )
new MasterScriptProviderFactory( xComponentContext ) );
}
//############################################################################
// Implementation of XServiceInfo
//############################################################################
OUString SAL_CALL
MasterScriptProviderFactory::getImplementationName()
OUString SAL_CALL MasterScriptProviderFactory::getImplementationName()
throw (RuntimeException)
{
return mspf_getImplementationName();
}
Sequence< OUString > SAL_CALL
MasterScriptProviderFactory::getSupportedServiceNames()
Sequence< OUString > SAL_CALL MasterScriptProviderFactory::getSupportedServiceNames()
throw (RuntimeException)
{
return mspf_getSupportedServiceNames();
......@@ -123,19 +102,7 @@ sal_Bool MasterScriptProviderFactory::supportsService(
OUString const & serviceName )
throw (RuntimeException)
{
// check();
Sequence< OUString > supported_services(
getSupportedServiceNames() );
OUString const * ar = supported_services.getConstArray();
for ( sal_Int32 pos = supported_services.getLength(); pos--; )
{
if (ar[ pos ].equals( serviceName ))
return true;
}
return false;
return cppu::supportsService(this, serviceName);
}
} // namespace browsenodefactory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment