Kaydet (Commit) a242f53c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up stoc::uriproc::supportsService

Change-Id: I1f324aae149e766d4755dc06ac5793c218ed5cf7
üst 68c3efcc
......@@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_exception_objects,stocservices,\
stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand \
stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript \
stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory \
stoc/source/uriproc/supportsService \
))
# vim:set noet sw=4 ts=4:
......@@ -20,8 +20,6 @@
#include "stocservices.hxx"
#include "supportsService.hxx"
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
......@@ -31,6 +29,7 @@
#include "com/sun/star/uno/XInterface.hpp"
#include "com/sun/star/uri/XExternalUriReferenceTranslator.hpp"
#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/supportsservice.hxx"
#include "cppuhelper/weak.hxx"
#include "osl/thread.h"
#include "rtl/string.h"
......@@ -89,8 +88,7 @@ OUString Translator::getImplementationName()
sal_Bool Translator::supportsService(OUString const & serviceName)
throw (css::uno::RuntimeException)
{
return stoc::uriproc::supportsService(
getSupportedServiceNames(), serviceName);
return cppu::supportsService(this, serviceName);
}
css::uno::Sequence< OUString > Translator::getSupportedServiceNames()
......
......@@ -42,6 +42,7 @@
#include "com/sun/star/uri/XUriSchemeParser.hpp"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/supportsservice.hxx"
#include "cppuhelper/weak.hxx"
#include "rtl/character.hxx"
#include "rtl/ustrbuf.hxx"
......@@ -50,7 +51,6 @@
#include "UriReference.hxx"
#include "stocservices.hxx"
#include "supportsService.hxx"
namespace {
......@@ -320,8 +320,7 @@ OUString Factory::getImplementationName()
sal_Bool Factory::supportsService(OUString const & serviceName)
throw (css::uno::RuntimeException)
{
return stoc::uriproc::supportsService(
getSupportedServiceNames(), serviceName);
return cppu::supportsService(this, serviceName);
}
css::uno::Sequence< OUString > Factory::getSupportedServiceNames()
......
......@@ -36,6 +36,7 @@
#include "com/sun/star/util/XMacroExpander.hpp"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/supportsservice.hxx"
#include "cppuhelper/weak.hxx"
#include "rtl/textenc.h"
#include "rtl/uri.h"
......@@ -45,7 +46,6 @@
#include "sal/types.h"
#include "UriReference.hxx"
#include "supportsService.hxx"
namespace {
......@@ -192,8 +192,7 @@ OUString Parser::getImplementationName()
::sal_Bool Parser::supportsService(OUString const & serviceName)
throw (css::uno::RuntimeException)
{
return ::stoc::uriproc::supportsService(
getSupportedServiceNames(), serviceName);
return cppu::supportsService(this, serviceName);
}
css::uno::Sequence< OUString > Parser::getSupportedServiceNames()
......
......@@ -21,7 +21,6 @@
#include "stocservices.hxx"
#include "UriReference.hxx"
#include "supportsService.hxx"
#include "com/sun/star/lang/IllegalArgumentException.hpp"
#include "com/sun/star/lang/XServiceInfo.hpp"
......@@ -34,6 +33,7 @@
#include "com/sun/star/uri/XVndSunStarScriptUrlReference.hpp"
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/supportsservice.hxx"
#include "cppuhelper/weak.hxx"
#include "osl/mutex.hxx"
#include "rtl/uri.hxx"
......@@ -414,8 +414,7 @@ OUString Parser::getImplementationName()
sal_Bool Parser::supportsService(OUString const & serviceName)
throw (css::uno::RuntimeException)
{
return stoc::uriproc::supportsService(
getSupportedServiceNames(), serviceName);
return cppu::supportsService(this, serviceName);
}
css::uno::Sequence< OUString > Parser::getSupportedServiceNames()
......
......@@ -20,8 +20,6 @@
#include "stocservices.hxx"
#include "supportsService.hxx"
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
......@@ -34,6 +32,7 @@
#include "com/sun/star/uri/XUriReferenceFactory.hpp"
#include "com/sun/star/uri/XVndSunStarPkgUrlReferenceFactory.hpp"
#include "cppuhelper/implbase2.hxx"
#include "cppuhelper/supportsservice.hxx"
#include "cppuhelper/weak.hxx"
#include "rtl/string.h"
#include "rtl/textenc.h"
......@@ -89,8 +88,7 @@ OUString Factory::getImplementationName()
sal_Bool Factory::supportsService(OUString const & serviceName)
throw (css::uno::RuntimeException)
{
return stoc::uriproc::supportsService(
getSupportedServiceNames(), serviceName);
return cppu::supportsService(this, serviceName);
}
css::uno::Sequence< OUString > Factory::getSupportedServiceNames()
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "supportsService.hxx"
#include "com/sun/star/uno/Sequence.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
namespace stoc { namespace uriproc {
bool supportsService(
com::sun::star::uno::Sequence< OUString > const & serviceNames,
OUString const & serviceName)
{
for (sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
if (serviceNames[i] == serviceName) {
return true;
}
}
return false;
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_stoc_source_uriproc_supportsService_hxx
#define INCLUDED_stoc_source_uriproc_supportsService_hxx
#include "com/sun/star/uno/Sequence.hxx"
namespace stoc { namespace uriproc {
bool supportsService(
com::sun::star::uno::Sequence< OUString > const & serviceNames,
OUString const & serviceName);
} }
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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