Hi Mikhail,
I have reimplemented the service and made the documentation from your
description about the service. By the way I changed the name of the
second parameter of the constructors from createTempCopy to bNoTempCopy,
since I realized it might be inconsistent with its real meaning in the
implementation. Could you please see if there's anything need to be
corrected? Thanks in advance. :-)
Best Regards,
Felix.
Mikhail Voitenko 写道:
> Hi Felix,
>
> You are right, the wrong define is an error that will be fixed by
> reimplementation.
>
> The attached in your previous mail hpp and hdl files look good, although
> they are automatically generated, and thus the possibility of a problem
> is quite small. Actually on last meeting I have meant that taking a look
> to them could help to understand the relation between IDL service
> constructor and XInitialization better. But checking them is not really
> necessary, it is enough to check the idl files.
>
> Best regards,
> Mikhail.
>
>
> Zhang Xiaofei wrote:
>
>> Hi Mikhail,
>>
>> P.S. to the last mail:
>>
>> I may have found something interesting in the pre-compile part of the
>> old xoldsimplestorage.hxx, since there are statements like:
>>
>> #ifndef _CPPUHELPER_IMPLBASE5_HXX_
>> #include <cppuhelper/implbase6.hxx>
>> #endif
>>
>> I assume this could be a potential defect. And it would be gone after
>> the reimplementation.
>>
>> Best Regards,
>> Felix.
>>
>>
>> Mikhail Voitenko 写道:
>>
>>
>>> Hi Felix,
>>>
>>> Currently I can not reproduce the problem in my environment. The only
>>> problem I had was a small typo that XOLESimpleStorage.idl includes
>>> Xinterface.idl instead of XInterface.idl.
>>>
>>> It looks like the problem reported by the log was fixed for the issue
>>> i69498. So it should be already in OOF680 branch. By the way, why don't
>>> you use one of the latest SRC680 builds? Working on a very old version
>>> is usually error-prone.
>>>
>>> Best Regards,
>>> Mikhail.
>>>
>>> Zhang Xiaofei wrote:
>>>
>>>
>>>
>>>> Hi Mikhail,
>>>>
>>>> I'm sorry but I encountered a problem compiling the offapi project: the
>>>> two ctors are regarded as having the "identical lists of parameter
>>>> types". It looks as if XStream and XInputStream are regarded as the same
>>>> type by the compiler. Could you please give me some hints here?
>>>>
>>>> By the way, are there any exceptions to be raised for the ctors?
>>>>
>>>> Thanks and Best Regards,
>>>> Felix.
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>
>
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ,v $
*
* $Revision: $
*
* last change: $Author: $ $Date: $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef __com_sun_star_embed_XOLESimpleStorage_idl__
#define __com_sun_star_embed_XOLESimpleStorage_idl__
#ifndef __com_sun_star_uno_XInterface_idl__
#include <com/sun/star/uno/XInterface.idl>
#endif
#ifndef __com_sun_star_container_XNameContainer_idl__
#include <com/sun/star/container/XNameContainer.idl>
#endif
#ifndef __com_sun_star_lang_XComponent_idl__
#include <com/sun/star/lang/XComponent.idl>
#endif
#ifndef __com_sun_star_embed_XTransactedObject_idl__
#include <com/sun/star/embed/XTransactedObject.idl>
#endif
#ifndef __com_sun_star_embed_XClassifiedObject_idl__
#include <com/sun/star/embed/XClassifiedObject.idl>
#endif
//============================================================================
module com { module sun { module star { module embed {
//============================================================================
/** This interface allows to access and change contents of OLE storages.
*/
interface XOLESimpleStorage
{
//INTERFACES
//
//------------------------------------------------------------------------
/** interface <type>XNameContainer</type> is the generic interface for
supporting the insertion and removal of named elements.<br>
The access to the elements is provided though
<type>XNameContainer</type> methods.
*/
interface ::com::sun::star::container::XNameContainer;
//------------------------------------------------------------------------
/** interface <type>XComponent</type> allows to exclicitly free
resources
and break cyclic references.<br>
*/
interface ::com::sun::star::lang::XComponent;
//------------------------------------------------------------------------
/** interface <type>XTransactedObject</type> allows transacted access to
an object.<br>
The storages are always opened in transdacted mode, the
<type>XTransactedObject</type> interface allows to commit the
storage.
*/
interface XTransactedObject;
//------------------------------------------------------------------------
/** interface <type>XClassifiedObject</type> represents common
functionality for embedded objects<br>
the <type>XClassifiedObject</type> interface allows to set/get
the
ClassID of the storage.
*/
interface XClassifiedObject;
};
//============================================================================
}; }; }; };
#endif
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ,v $
*
* $Revision: $
*
* last change: $Author: $ $Date: $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef __com_sun_star_embed_OLESimpleStorage_idl__
#define __com_sun_star_embed_OLESimpleStorage_idl__
#ifndef __com_sun_star_embed_XOLESimpleStorage_idl__
#include <com/sun/star/embed/XOLESimpleStorage.idl>
#endif
#ifndef __com_sun_star_io_XInputStream_idl__
#include <com/sun/star/io/XInputStream.idl>
#endif
#ifndef __com_sun_star_io_XStream_idl__
#include <com/sun/star/io/XStream.idl>
#endif
//============================================================================
module com { module sun { module star { module embed {
//============================================================================
/** This service provides a simple functionality to allow
read/write the storages in OLE storage format.
*/
service OLESimpleStorage: XOLESimpleStorage
{
//CONSTRUCTORS
//
/** is used to initialize the object on it's creation.
@param xInputStream
[in] the InputStream that contains data in OLE
storage format.
@param bNoTempCopy
[in] specifies whether a temporary copy should
be created during
substreams opening.
*/
createFromInputStream ([in] ::com::sun::star::io::XInputStream
xInputStream, [in] boolean bNoTempCopy);
/** is used to initialize the object on it's creation.
@param xStream
[in] the Stream that contains data in OLE
storage format.
@param bNoTempCopy
[in] specifies whether a temporary copy should
be created during
substreams opening.
*/
createFromStream ([in] ::com::sun::star::io::XStream xStream, [in]
boolean bNoTempCopy);
};
//============================================================================
}; }; }; };
#endif
/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xolesimplestorage.hxx,v $
*
* $Revision: 1.7 $
*
* last change: $Author: hr $ $Date: 2006/05/09 15:42:46 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef __XOLESIMPLESTORAGE_HXX_
#define __XOLESIMPLESTORAGE_HXX_
#ifndef _COM_SUN_STAR_EMBED_XOLESIMPLESTORAGE_HPP_
#include <com/sun/star/embed/XOLESimpleStorage.hpp>
#endif
#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include <com/sun/star/container/XNameContainer.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
#include <com/sun/star/lang/XComponent.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
#include <com/sun/star/lang/XInitialization.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include <com/sun/star/lang/XServiceInfo.hpp>
#endif
#ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
#include <com/sun/star/embed/XTransactedObject.hpp>
#endif
#ifndef _COM_SUN_STAR_EMBED_XCLASSIFIEDOBJECT_HPP_
#include <com/sun/star/embed/XClassifiedObject.hpp>
#endif
#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
#include <com/sun/star/io/XOutputStream.hpp>
#endif
#ifndef _CPPUHELPER_IMPLBASE3_HXX_
#include <cppuhelper/implbase3.hxx>
#endif
#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
#include <cppuhelper/interfacecontainer.h>
#endif
#include <osl/mutex.hxx>
#include <stg.hxx>
class OLESimpleStorage : public ::cppu::WeakImplHelper3
< ::com::sun::star::embed::XOLESimpleStorage
, ::com::sun::star::lang::XInitialization
, ::com::sun::star::lang::XServiceInfo >
{
::osl::Mutex m_aMutex;
sal_Bool m_bDisposed;
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
m_xStream;
::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >
m_xTempStream;
SvStream* m_pStream;
BaseStorage* m_pStorage;
::cppu::OInterfaceContainerHelper* m_pListenersContainer; // list of
listeners
::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
sal_Bool m_bNoTemporaryCopy;
void UpdateOriginal_Impl();
static void InsertInputStreamToStorage_Impl( BaseStorage* pStorage,
::rtl::OUString aName, const ::com::sun::star::uno::Reference<
::com::sun::star::io::XInputStream >& xInputStream )
throw ( ::com::sun::star::uno::Exception );
static void InsertNameAccessToStorage_Impl( BaseStorage* pStorage,
::rtl::OUString aName, const ::com::sun::star::uno::Reference<
::com::sun::star::container::XNameAccess >& xNameAccess )
throw ( ::com::sun::star::uno::Exception );
public:
OLESimpleStorage( ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > xFactory );
virtual ~OLESimpleStorage();
static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
impl_staticGetSupportedServiceNames();
static ::rtl::OUString SAL_CALL impl_staticGetImplementationName();
static ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface > SAL_CALL
impl_staticCreateSelfInstance(
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >& xServiceManager );
//____________________________________________________________________________________________________
// XInitialization
//____________________________________________________________________________________________________
virtual void SAL_CALL initialize( const
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
throw ( ::com::sun::star::uno::Exception,
::com::sun::star::uno::RuntimeException);
//____________________________________________________________________________________________________
// XNameContainer
//____________________________________________________________________________________________________
virtual void SAL_CALL insertByName( const ::rtl::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 ::rtl::OUString& Name )
throw ( ::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName,
const ::com::sun::star::uno::Any& aElement )
throw ( ::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getByName( const
::rtl::OUString& aName )
throw ( ::com::sun::star::container::NoSuchElementException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
getElementNames()
throw ( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
throw ( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
throw ( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL hasElements()
throw ( ::com::sun::star::uno::RuntimeException );
//____________________________________________________________________________________________________
// XComponent
//____________________________________________________________________________________________________
virtual void SAL_CALL dispose()
throw ( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL addEventListener(
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XEventListener >& xListener )
throw ( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL removeEventListener(
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XEventListener >& xListener )
throw ( ::com::sun::star::uno::RuntimeException );
//____________________________________________________________________________________________________
// XTransactedObject
//____________________________________________________________________________________________________
virtual void SAL_CALL commit()
throw ( ::com::sun::star::io::IOException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL revert()
throw ( ::com::sun::star::io::IOException,
::com::sun::star::lang::WrappedTargetException,
::com::sun::star::uno::RuntimeException );
//____________________________________________________________________________________________________
// XClassifiedObject
//____________________________________________________________________________________________________
virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL
getClassID()
throw ( ::com::sun::star::uno::RuntimeException );
virtual ::rtl::OUString SAL_CALL getClassName()
throw ( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL setClassInfo( const
::com::sun::star::uno::Sequence< ::sal_Int8 >& aClassID,
const ::rtl::OUString& sClassName )
throw ( ::com::sun::star::lang::NoSupportException,
::com::sun::star::uno::RuntimeException );
//____________________________________________________________________________________________________
// XServiceInfo
//____________________________________________________________________________________________________
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw ( ::com::sun::star::uno::RuntimeException );
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString&
ServiceName )
throw ( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
getSupportedServiceNames()
throw ( ::com::sun::star::uno::RuntimeException );
};
#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]