Kaydet (Commit) 7f36d2e2 authored tarafından Matúš Kukan's avatar Matúš Kukan

tdf#74608: Ctor function for css.embed.OLESimpleStorage

Change-Id: I20b91ad65514e27094ff702d1d94a48ef9a82fe6
üst 3b7150c0
......@@ -51,7 +51,6 @@ $(eval $(call gb_Library_use_libraries,sot,\
$(eval $(call gb_Library_add_exception_objects,sot,\
sot/source/unoolestorage/xolesimplestorage \
sot/source/unoolestorage/register \
sot/source/base/formats \
sot/source/base/object \
sot/source/base/exchange \
......
/* -*- 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 <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/registry/InvalidRegistryException.hpp>
#include <cppuhelper/factory.hxx>
#include "xolesimplestorage.hxx"
using namespace ::com::sun::star;
extern "C" {
SAL_DLLPUBLIC_EXPORT void * SAL_CALL sot_component_getFactory(
const sal_Char * pImplName, void * pServiceManager,
SAL_UNUSED_PARAMETER void * /*pRegistryKey*/ )
{
void * pRet = nullptr;
OUString aImplName( OUString::createFromAscii( pImplName ) );
uno::Reference< lang::XSingleServiceFactory > xFactory;
if ( pServiceManager && aImplName.equals( OLESimpleStorage::impl_staticGetImplementationName() ) )
{
xFactory= ::cppu::createSingleFactory( static_cast< lang::XMultiServiceFactory*>( pServiceManager ),
OLESimpleStorage::impl_staticGetImplementationName(),
OLESimpleStorage::impl_staticCreateSelfInstance,
OLESimpleStorage::impl_staticGetSupportedServiceNames() );
}
if ( xFactory.is() )
{
xFactory->acquire();
pRet = xFactory.get();
}
return pRet;
}
} // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -20,6 +20,8 @@
#ifndef INCLUDED_SOT_SOURCE_UNOOLESTORAGE_XOLESIMPLESTORAGE_HXX
#define INCLUDED_SOT_SOURCE_UNOOLESTORAGE_XOLESIMPLESTORAGE_HXX
#include <sal/config.h>
#include <com/sun/star/embed/XOLESimpleStorage.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XComponent.hpp>
......@@ -27,21 +29,13 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <osl/mutex.hxx>
#include <sot/stg.hxx>
class OLESimpleStorage : public ::cppu::WeakImplHelper
< css::embed::XOLESimpleStorage
, css::lang::XInitialization
, css::lang::XServiceInfo >
class OLESimpleStorage : public cppu::WeakImplHelper<css::embed::XOLESimpleStorage, css::lang::XServiceInfo>
{
::osl::Mutex m_aMutex;
......@@ -53,7 +47,7 @@ class OLESimpleStorage : public ::cppu::WeakImplHelper
BaseStorage* m_pStorage;
::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of listeners
css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory;
css::uno::Reference<css::uno::XComponentContext> m_xContext;
bool m_bNoTemporaryCopy;
......@@ -67,29 +61,13 @@ class OLESimpleStorage : public ::cppu::WeakImplHelper
public:
explicit OLESimpleStorage( css::uno::Reference< css::lang::XMultiServiceFactory > xFactory );
OLESimpleStorage(css::uno::Reference<css::uno::XComponentContext> xContext,
css::uno::Sequence<css::uno::Any> const &arguments);
virtual ~OLESimpleStorage();
static css::uno::Sequence< OUString > SAL_CALL impl_staticGetSupportedServiceNames();
static OUString SAL_CALL impl_staticGetImplementationName();
static css::uno::Reference< css::uno::XInterface > SAL_CALL
impl_staticCreateSelfInstance(
const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager );
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
throw ( css::uno::Exception,
css::uno::RuntimeException, std::exception) override;
// XNameContainer
virtual void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement )
throw ( css::lang::IllegalArgumentException,
css::container::ElementExistException,
......@@ -124,10 +102,8 @@ public:
virtual sal_Bool SAL_CALL hasElements()
throw ( css::uno::RuntimeException, std::exception ) override;
// XComponent
virtual void SAL_CALL dispose()
throw ( css::uno::RuntimeException, std::exception ) override;
......@@ -139,10 +115,8 @@ public:
const css::uno::Reference< css::lang::XEventListener >& xListener )
throw ( css::uno::RuntimeException, std::exception ) override;
// XTransactedObject
virtual void SAL_CALL commit()
throw ( css::io::IOException,
css::lang::WrappedTargetException,
......@@ -153,10 +127,8 @@ public:
css::lang::WrappedTargetException,
css::uno::RuntimeException, std::exception ) override;
// XClassifiedObject
virtual css::uno::Sequence< ::sal_Int8 > SAL_CALL getClassID()
throw ( css::uno::RuntimeException, std::exception ) override;
......@@ -168,10 +140,8 @@ public:
throw ( css::lang::NoSupportException,
css::uno::RuntimeException, std::exception ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName()
throw ( css::uno::RuntimeException, std::exception ) override;
......@@ -180,7 +150,6 @@ public:
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
throw ( css::uno::RuntimeException, std::exception ) override;
};
#endif
......
......@@ -18,8 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="sot" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.embed.OLESimpleStorage">
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.embed.OLESimpleStorage"
constructor="com_sun_star_comp_embed_OLESimpleStorage">
<service name="com.sun.star.embed.OLESimpleStorage"/>
</implementation>
</component>
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