summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-24 14:55:08 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-25 08:07:04 +0000
commitda5449da0c056a3a0da239eff2e2b8b66cfd6224 (patch)
tree6f6698e676726bd8a07f281a9707e448a711d983 /odk/examples/DevelopersGuide
parent01a13519e2a12e1e9b61bab1437d340e389e44bf (diff)
fdo#54938: More uses of cppu::supportsService
Change-Id: Id6bed78d92eba52283a17ab3ca66e751c225e48d Reviewed-on: https://gerrit.libreoffice.org/6423 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'odk/examples/DevelopersGuide')
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx16
-rw-r--r--odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx19
2 files changed, 9 insertions, 26 deletions
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
index 762453bbb9eb..78d8145f8cd5 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SDriver.cxx
@@ -33,6 +33,7 @@
*
*************************************************************************/
+#include <cppuhelper/supportsservice.hxx>
#include "SDriver.hxx"
#include "SConnection.hxx"
@@ -46,7 +47,6 @@ namespace connectivity
{
namespace skeleton
{
- //------------------------------------------------------------------
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SkeletonDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
{
return *(new SkeletonDriver());
@@ -83,7 +83,7 @@ rtl::OUString SkeletonDriver::getImplementationName_Static( ) throw(RuntimeExce
// this name is referenced in the configuration and in the skeleton.xml
// Please take care when changing it.
}
-//------------------------------------------------------------------------------
+
Sequence< ::rtl::OUString > SkeletonDriver::getSupportedServiceNames_Static( ) throw (RuntimeException)
{
// which service is supported
@@ -93,31 +93,21 @@ Sequence< ::rtl::OUString > SkeletonDriver::getSupportedServiceNames_Static( )
return aSNS;
}
-//------------------------------------------------------------------
::rtl::OUString SAL_CALL SkeletonDriver::getImplementationName( ) throw(RuntimeException)
{
return getImplementationName_Static();
}
-//------------------------------------------------------------------
sal_Bool SAL_CALL SkeletonDriver::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
+ return cppu::supportsService(this, _rServiceName);
}
-//------------------------------------------------------------------
Sequence< ::rtl::OUString > SAL_CALL SkeletonDriver::getSupportedServiceNames( ) throw(RuntimeException)
{
return getSupportedServiceNames_Static();
}
-// --------------------------------------------------------------------------------
Reference< XConnection > SAL_CALL SkeletonDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
{
// create a new connection with the given properties and append it to our vector
diff --git a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
index 196f06182f17..63a029438b57 100644
--- a/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
+++ b/odk/examples/DevelopersGuide/Database/DriverSkeleton/SResultSet.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/sdbcx/CompareBookmark.hpp>
#include <cppuhelper/typeprovider.hxx>
+#include <cppuhelper/supportsService.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include "propertyids.hxx"
@@ -53,13 +54,12 @@ using namespace com::sun::star::container;
using namespace com::sun::star::io;
using namespace com::sun::star::util;
-//------------------------------------------------------------------------------
// IMPLEMENT_SERVICE_INFO(OResultSet,"com.sun.star.sdbcx.OResultSet","com.sun.star.sdbc.ResultSet");
::rtl::OUString SAL_CALL OResultSet::getImplementationName( ) throw ( RuntimeException) \
{
return ::rtl::OUString("com.sun.star.sdbcx.skeleton.ResultSet");
}
-// -------------------------------------------------------------------------
+
Sequence< ::rtl::OUString > SAL_CALL OResultSet::getSupportedServiceNames( ) throw( RuntimeException)
{
Sequence< ::rtl::OUString > aSupported(2);
@@ -67,19 +67,12 @@ using namespace com::sun::star::util;
aSupported[1] = ::rtl::OUString("com.sun.star.sdbcx.ResultSet");
return aSupported;
}
-// -------------------------------------------------------------------------
+
sal_Bool SAL_CALL OResultSet::supportsService( const ::rtl::OUString& _rServiceName ) throw( RuntimeException)
{
- Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames());
- const ::rtl::OUString* pSupported = aSupported.getConstArray();
- const ::rtl::OUString* pEnd = pSupported + aSupported.getLength();
- for (;pSupported != pEnd && !pSupported->equals(_rServiceName); ++pSupported)
- ;
-
- return pSupported != pEnd;
+ return cppu::supportsService(this, _rServiceName);
}
-// -------------------------------------------------------------------------
OResultSet::OResultSet(OStatement_Base* pStmt)
: OResultSet_BASE(m_aMutex)
,OPropertySetHelper(OResultSet_BASE::rBHelper)
@@ -90,11 +83,11 @@ OResultSet::OResultSet(OStatement_Base* pStmt)
,m_bWasNull(sal_True)
{
}
-// -------------------------------------------------------------------------
+
OResultSet::~OResultSet()
{
}
-// -------------------------------------------------------------------------
+
void OResultSet::disposing(void)
{
OPropertySetHelper::disposing();