Kaydet (Commit) 864afb34 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

use WeakImplhelper1 for ContentIdentifier

Change-Id: I830d2642bde6affbc400fbaab11955ac082b7bc5
üst 20ed6886
......@@ -31,15 +31,9 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
// ContentIdentifier Implementation.
ContentIdentifier::ContentIdentifier(
const OUString& ContentId )
: m_aContentId( ContentId )
ContentIdentifier::ContentIdentifier( const OUString& ContentId )
: m_aContentId( ContentId )
{
}
......@@ -50,46 +44,7 @@ ContentIdentifier::~ContentIdentifier()
}
// XInterface methods.
void SAL_CALL ContentIdentifier::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL ContentIdentifier::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL ContentIdentifier::queryInterface(
const css::uno::Type & rType )
throw( css::uno::RuntimeException, std::exception )
{
css::uno::Any aRet = cppu::queryInterface( rType,
(static_cast< XTypeProvider* >(this)),
(static_cast< XContentIdentifier* >(this))
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods.
XTYPEPROVIDER_IMPL_2( ContentIdentifier,
XTypeProvider,
XContentIdentifier );
// XContentIdentifier methods.
// virtual
OUString SAL_CALL ContentIdentifier::getContentIdentifier()
throw( RuntimeException, std::exception )
......
......@@ -21,39 +21,22 @@
#define _IDENTIFY_HXX
#include <com/sun/star/ucb/XContentIdentifier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/weak.hxx>
#include <ucbhelper/macros.hxx>
#include <cppuhelper/implbase1.hxx>
class ContentIdentifier :
public cppu::OWeakObject,
public com::sun::star::lang::XTypeProvider,
public com::sun::star::ucb::XContentIdentifier
class ContentIdentifier : public cppu::WeakImplHelper1 <
css::ucb::XContentIdentifier >
{
public:
ContentIdentifier( const OUString& ContentId );
virtual ~ContentIdentifier();
// XInterface
virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType )
throw( css::uno::RuntimeException, std::exception );
virtual void SAL_CALL acquire()
throw();
virtual void SAL_CALL release()
throw();
// XTypeProvider
XTYPEPROVIDER_DECL()
// XContentIdentifier
virtual OUString SAL_CALL getContentIdentifier()
throw( com::sun::star::uno::RuntimeException, std::exception );
throw( css::uno::RuntimeException, std::exception );
virtual OUString SAL_CALL getContentProviderScheme()
throw( com::sun::star::uno::RuntimeException, std::exception );
throw( css::uno::RuntimeException, std::exception );
private:
OUString m_aContentId;
......
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