1*bfd08df8SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*bfd08df8SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*bfd08df8SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*bfd08df8SAndrew Rist  * distributed with this work for additional information
6*bfd08df8SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*bfd08df8SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*bfd08df8SAndrew Rist  * "License"); you may not use this file except in compliance
9*bfd08df8SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*bfd08df8SAndrew Rist  *
11*bfd08df8SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*bfd08df8SAndrew Rist  *
13*bfd08df8SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*bfd08df8SAndrew Rist  * software distributed under the License is distributed on an
15*bfd08df8SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*bfd08df8SAndrew Rist  * KIND, either express or implied.  See the License for the
17*bfd08df8SAndrew Rist  * specific language governing permissions and limitations
18*bfd08df8SAndrew Rist  * under the License.
19*bfd08df8SAndrew Rist  *
20*bfd08df8SAndrew Rist  *************************************************************/
21*bfd08df8SAndrew Rist 
22*bfd08df8SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_embeddedobj.hxx"
26cdf0e10cSrcweir #include <com/sun/star/embed/ElementModes.hpp>
27cdf0e10cSrcweir #include <com/sun/star/embed/EntryInitModes.hpp>
28cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
29cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
30cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
31cdf0e10cSrcweir #include <com/sun/star/embed/Aspects.hpp>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <rtl/logfile.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir #include "xolefactory.hxx"
37cdf0e10cSrcweir #include "oleembobj.hxx"
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 
40cdf0e10cSrcweir using namespace ::com::sun::star;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir // TODO: do not create OLE objects that represent OOo documents
43cdf0e10cSrcweir 
44cdf0e10cSrcweir //-------------------------------------------------------------------------
impl_staticGetSupportedServiceNames()45cdf0e10cSrcweir uno::Sequence< ::rtl::OUString > SAL_CALL OleEmbeddedObjectFactory::impl_staticGetSupportedServiceNames()
46cdf0e10cSrcweir {
47cdf0e10cSrcweir     uno::Sequence< ::rtl::OUString > aRet(2);
48cdf0e10cSrcweir     aRet[0] = ::rtl::OUString::createFromAscii("com.sun.star.embed.OLEEmbeddedObjectFactory");
49cdf0e10cSrcweir     aRet[1] = ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.OLEEmbeddedObjectFactory");
50cdf0e10cSrcweir     return aRet;
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
53cdf0e10cSrcweir //-------------------------------------------------------------------------
impl_staticGetImplementationName()54cdf0e10cSrcweir ::rtl::OUString SAL_CALL OleEmbeddedObjectFactory::impl_staticGetImplementationName()
55cdf0e10cSrcweir {
56cdf0e10cSrcweir     return ::rtl::OUString::createFromAscii("com.sun.star.comp.embed.OLEEmbeddedObjectFactory");
57cdf0e10cSrcweir }
58cdf0e10cSrcweir 
59cdf0e10cSrcweir //-------------------------------------------------------------------------
impl_staticCreateSelfInstance(const uno::Reference<lang::XMultiServiceFactory> & xServiceManager)60cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::impl_staticCreateSelfInstance(
61cdf0e10cSrcweir 			const uno::Reference< lang::XMultiServiceFactory >& xServiceManager )
62cdf0e10cSrcweir {
63cdf0e10cSrcweir 	return uno::Reference< uno::XInterface >( *new OleEmbeddedObjectFactory( xServiceManager ) );
64cdf0e10cSrcweir }
65cdf0e10cSrcweir 
66cdf0e10cSrcweir //-------------------------------------------------------------------------
createInstanceInitFromEntry(const uno::Reference<embed::XStorage> & xStorage,const::rtl::OUString & sEntName,const uno::Sequence<beans::PropertyValue> & aMedDescr,const uno::Sequence<beans::PropertyValue> & lObjArgs)67cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInstanceInitFromEntry(
68cdf0e10cSrcweir 																	const uno::Reference< embed::XStorage >& xStorage,
69cdf0e10cSrcweir 																	const ::rtl::OUString& sEntName,
70cdf0e10cSrcweir 																	const uno::Sequence< beans::PropertyValue >& aMedDescr,
71cdf0e10cSrcweir 																	const uno::Sequence< beans::PropertyValue >& lObjArgs )
72cdf0e10cSrcweir 	throw ( lang::IllegalArgumentException,
73cdf0e10cSrcweir 			container::NoSuchElementException,
74cdf0e10cSrcweir 			io::IOException,
75cdf0e10cSrcweir 			uno::Exception,
76cdf0e10cSrcweir 			uno::RuntimeException)
77cdf0e10cSrcweir {
78cdf0e10cSrcweir 	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromEntry" );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	if ( !xStorage.is() )
81cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ),
82cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
83cdf0e10cSrcweir 											1 );
84cdf0e10cSrcweir 
85cdf0e10cSrcweir 	if ( !sEntName.getLength() )
86cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ),
87cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
88cdf0e10cSrcweir 											2 );
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
91cdf0e10cSrcweir 	if ( !xNameAccess.is() )
92cdf0e10cSrcweir 		throw uno::RuntimeException(); //TODO
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	// detect entry existence
95cdf0e10cSrcweir 	if ( !xNameAccess->hasByName( sEntName ) )
96cdf0e10cSrcweir 		throw container::NoSuchElementException();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	if ( !xStorage->isStreamElement( sEntName ) )
99cdf0e10cSrcweir 	{
100cdf0e10cSrcweir 		// if it is not an OLE object throw an exception
101cdf0e10cSrcweir 		throw io::IOException(); // TODO:
102cdf0e10cSrcweir 	}
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	uno::Reference< uno::XInterface > xResult(
105cdf0e10cSrcweir 					static_cast< ::cppu::OWeakObject* > ( new OleEmbeddedObject( m_xFactory, sal_False ) ),
106cdf0e10cSrcweir 					uno::UNO_QUERY );
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 	uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
109cdf0e10cSrcweir 
110cdf0e10cSrcweir 	if ( !xPersist.is() )
111cdf0e10cSrcweir 		throw uno::RuntimeException(); // TODO: the interface must be supported by own document objects
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	xPersist->setPersistentEntry( xStorage,
114cdf0e10cSrcweir 									sEntName,
115cdf0e10cSrcweir 									embed::EntryInitModes::DEFAULT_INIT,
116cdf0e10cSrcweir 									aMedDescr,
117cdf0e10cSrcweir 									lObjArgs );
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     for ( sal_Int32 nInd = 0; nInd < lObjArgs.getLength(); nInd++ )
120cdf0e10cSrcweir 	{
121cdf0e10cSrcweir         if ( lObjArgs[nInd].Name.equalsAscii( "CloneFrom" ) )
122cdf0e10cSrcweir         {
123cdf0e10cSrcweir             try
124cdf0e10cSrcweir             {
125cdf0e10cSrcweir                 uno::Reference < embed::XEmbeddedObject > xObj;
126cdf0e10cSrcweir                 uno::Reference < embed::XEmbeddedObject > xNew( xResult, uno::UNO_QUERY );
127cdf0e10cSrcweir                 lObjArgs[nInd].Value >>= xObj;
128cdf0e10cSrcweir                 if ( xObj.is() )
129cdf0e10cSrcweir                     xNew->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, xObj->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ) );
130cdf0e10cSrcweir             }
131cdf0e10cSrcweir             catch ( uno::Exception& ) {};
132cdf0e10cSrcweir             break;
133cdf0e10cSrcweir         }
134cdf0e10cSrcweir     }
135cdf0e10cSrcweir 
136cdf0e10cSrcweir 	return xResult;
137cdf0e10cSrcweir }
138cdf0e10cSrcweir 
139cdf0e10cSrcweir //-------------------------------------------------------------------------
createInstanceInitFromMediaDescriptor(const uno::Reference<embed::XStorage> & xStorage,const::rtl::OUString & sEntName,const uno::Sequence<beans::PropertyValue> & aMediaDescr,const uno::Sequence<beans::PropertyValue> & lObjArgs)140cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor(
141cdf0e10cSrcweir 		const uno::Reference< embed::XStorage >& xStorage,
142cdf0e10cSrcweir 		const ::rtl::OUString& sEntName,
143cdf0e10cSrcweir 		const uno::Sequence< beans::PropertyValue >& aMediaDescr,
144cdf0e10cSrcweir 		const uno::Sequence< beans::PropertyValue >& lObjArgs )
145cdf0e10cSrcweir 	throw ( lang::IllegalArgumentException,
146cdf0e10cSrcweir 			io::IOException,
147cdf0e10cSrcweir 			uno::Exception,
148cdf0e10cSrcweir 			uno::RuntimeException)
149cdf0e10cSrcweir {
150cdf0e10cSrcweir 	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 	if ( !xStorage.is() )
153cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ),
154cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
155cdf0e10cSrcweir 											1 );
156cdf0e10cSrcweir 
157cdf0e10cSrcweir 	if ( !sEntName.getLength() )
158cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ),
159cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
160cdf0e10cSrcweir 											2 );
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 	uno::Reference< uno::XInterface > xResult(
163cdf0e10cSrcweir 					static_cast< ::cppu::OWeakObject* > ( new OleEmbeddedObject( m_xFactory, sal_False ) ),
164cdf0e10cSrcweir 					uno::UNO_QUERY );
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 	uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	if ( !xPersist.is() )
169cdf0e10cSrcweir 		throw uno::RuntimeException(); // TODO: the interface must be supported ( what about applets? )
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	xPersist->setPersistentEntry( xStorage,
172cdf0e10cSrcweir 									sEntName,
173cdf0e10cSrcweir 									embed::EntryInitModes::MEDIA_DESCRIPTOR_INIT,
174cdf0e10cSrcweir 									aMediaDescr,
175cdf0e10cSrcweir 									lObjArgs );
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	return xResult;
178cdf0e10cSrcweir }
179cdf0e10cSrcweir 
180cdf0e10cSrcweir //-------------------------------------------------------------------------
createInstanceInitNew(const uno::Sequence<sal_Int8> & aClassID,const::rtl::OUString & aClassName,const uno::Reference<embed::XStorage> & xStorage,const::rtl::OUString & sEntName,const uno::Sequence<beans::PropertyValue> & lObjArgs)181cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInstanceInitNew(
182cdf0e10cSrcweir 											const uno::Sequence< sal_Int8 >& aClassID,
183cdf0e10cSrcweir 											const ::rtl::OUString& aClassName,
184cdf0e10cSrcweir 											const uno::Reference< embed::XStorage >& xStorage,
185cdf0e10cSrcweir 											const ::rtl::OUString& sEntName,
186cdf0e10cSrcweir 											const uno::Sequence< beans::PropertyValue >& lObjArgs )
187cdf0e10cSrcweir 	throw ( lang::IllegalArgumentException,
188cdf0e10cSrcweir 			io::IOException,
189cdf0e10cSrcweir 			uno::Exception,
190cdf0e10cSrcweir 			uno::RuntimeException)
191cdf0e10cSrcweir {
192cdf0e10cSrcweir 	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitNew" );
193cdf0e10cSrcweir 
194cdf0e10cSrcweir 	if ( !xStorage.is() )
195cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ),
196cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
197cdf0e10cSrcweir 											3 );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	if ( !sEntName.getLength() )
200cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ),
201cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
202cdf0e10cSrcweir 											4 );
203cdf0e10cSrcweir 
204cdf0e10cSrcweir 	uno::Reference< uno::XInterface > xResult(
205cdf0e10cSrcweir 					static_cast< ::cppu::OWeakObject* > ( new OleEmbeddedObject( m_xFactory, aClassID, aClassName ) ),
206cdf0e10cSrcweir 					uno::UNO_QUERY );
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 	if ( !xPersist.is() )
211cdf0e10cSrcweir 		throw uno::RuntimeException(); // TODO: the interface must be supported by own document objects
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 	xPersist->setPersistentEntry( xStorage,
214cdf0e10cSrcweir 									sEntName,
215cdf0e10cSrcweir 									embed::EntryInitModes::TRUNCATE_INIT,
216cdf0e10cSrcweir 									uno::Sequence< beans::PropertyValue >(),
217cdf0e10cSrcweir 									lObjArgs );
218cdf0e10cSrcweir 
219cdf0e10cSrcweir 	return xResult;
220cdf0e10cSrcweir }
221cdf0e10cSrcweir 
222cdf0e10cSrcweir //-------------------------------------------------------------------------
createInstanceLink(const uno::Reference<embed::XStorage> & xStorage,const::rtl::OUString & sEntName,const uno::Sequence<beans::PropertyValue> & aMediaDescr,const uno::Sequence<beans::PropertyValue> & lObjArgs)223cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInstanceLink(
224cdf0e10cSrcweir 											const uno::Reference< embed::XStorage >& xStorage,
225cdf0e10cSrcweir 											const ::rtl::OUString& sEntName,
226cdf0e10cSrcweir 											const uno::Sequence< beans::PropertyValue >& aMediaDescr,
227cdf0e10cSrcweir 											const uno::Sequence< beans::PropertyValue >& lObjArgs )
228cdf0e10cSrcweir 		throw ( lang::IllegalArgumentException,
229cdf0e10cSrcweir 				io::IOException,
230cdf0e10cSrcweir 				uno::Exception,
231cdf0e10cSrcweir 				uno::RuntimeException )
232cdf0e10cSrcweir {
233cdf0e10cSrcweir 	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceLink" );
234cdf0e10cSrcweir 
235cdf0e10cSrcweir 	if ( !xStorage.is() )
236cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ),
237cdf0e10cSrcweir 											uno::Reference< uno::XInterface >(
238cdf0e10cSrcweir 												static_cast< ::cppu::OWeakObject* >(this) ),
239cdf0e10cSrcweir 											1 );
240cdf0e10cSrcweir 
241cdf0e10cSrcweir 	if ( !sEntName.getLength() )
242cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ),
243cdf0e10cSrcweir 											uno::Reference< uno::XInterface >(
244cdf0e10cSrcweir 												static_cast< ::cppu::OWeakObject* >(this) ),
245cdf0e10cSrcweir 											2 );
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 	uno::Reference< uno::XInterface > xResult(
248cdf0e10cSrcweir 				static_cast< ::cppu::OWeakObject* > ( new OleEmbeddedObject( m_xFactory, sal_True ) ),
249cdf0e10cSrcweir 				uno::UNO_QUERY );
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
252cdf0e10cSrcweir 
253cdf0e10cSrcweir 	if ( !xPersist.is() )
254cdf0e10cSrcweir 		throw uno::RuntimeException(); // TODO: the interface must be supported by own document objects
255cdf0e10cSrcweir 
256cdf0e10cSrcweir 	xPersist->setPersistentEntry( xStorage,
257cdf0e10cSrcweir 									sEntName,
258cdf0e10cSrcweir 									embed::EntryInitModes::MEDIA_DESCRIPTOR_INIT,
259cdf0e10cSrcweir 									aMediaDescr,
260cdf0e10cSrcweir 									lObjArgs );
261cdf0e10cSrcweir 
262cdf0e10cSrcweir 	return xResult;
263cdf0e10cSrcweir }
264cdf0e10cSrcweir 
265cdf0e10cSrcweir //-------------------------------------------------------------------------
createInstanceUserInit(const uno::Sequence<sal_Int8> & aClassID,const::rtl::OUString & aClassName,const uno::Reference<embed::XStorage> & xStorage,const::rtl::OUString & sEntName,sal_Int32,const uno::Sequence<beans::PropertyValue> &,const uno::Sequence<beans::PropertyValue> & lObjArgs)266cdf0e10cSrcweir uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInstanceUserInit(
267cdf0e10cSrcweir 			const uno::Sequence< sal_Int8 >& aClassID,
268cdf0e10cSrcweir 			const ::rtl::OUString& aClassName,
269cdf0e10cSrcweir 			const uno::Reference< embed::XStorage >& xStorage,
270cdf0e10cSrcweir 			const ::rtl::OUString& sEntName,
271cdf0e10cSrcweir 			sal_Int32 /*nEntryConnectionMode*/,
272cdf0e10cSrcweir 			const uno::Sequence< beans::PropertyValue >& /*lArguments*/,
273cdf0e10cSrcweir 			const uno::Sequence< beans::PropertyValue >& lObjArgs )
274cdf0e10cSrcweir 	throw ( lang::IllegalArgumentException,
275cdf0e10cSrcweir 			io::IOException,
276cdf0e10cSrcweir 			uno::Exception,
277cdf0e10cSrcweir 			uno::RuntimeException )
278cdf0e10cSrcweir {
279cdf0e10cSrcweir 	RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceUserInit" );
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 	// the initialization is completelly controlled by user
282cdf0e10cSrcweir 	if ( !xStorage.is() )
283cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "No parent storage is provided!\n" ),
284cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
285cdf0e10cSrcweir 											1 );
286cdf0e10cSrcweir 
287cdf0e10cSrcweir 	if ( !sEntName.getLength() )
288cdf0e10cSrcweir 		throw lang::IllegalArgumentException( ::rtl::OUString::createFromAscii( "Empty element name is provided!\n" ),
289cdf0e10cSrcweir 											uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
290cdf0e10cSrcweir 											2 );
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	uno::Reference< uno::XInterface > xResult(
293cdf0e10cSrcweir 				static_cast< ::cppu::OWeakObject* > ( new OleEmbeddedObject( m_xFactory, aClassID, aClassName ) ),
294cdf0e10cSrcweir 				uno::UNO_QUERY );
295cdf0e10cSrcweir 
296cdf0e10cSrcweir 	uno::Reference< embed::XEmbedPersist > xPersist( xResult, uno::UNO_QUERY );
297cdf0e10cSrcweir 	if ( xPersist.is() )
298cdf0e10cSrcweir 	{
299cdf0e10cSrcweir 		xPersist->setPersistentEntry( xStorage,
300cdf0e10cSrcweir 									sEntName,
301cdf0e10cSrcweir 									embed::EntryInitModes::DEFAULT_INIT,
302cdf0e10cSrcweir 									uno::Sequence< beans::PropertyValue >(),
303cdf0e10cSrcweir 									lObjArgs );
304cdf0e10cSrcweir 
305cdf0e10cSrcweir 	}
306cdf0e10cSrcweir 	else
307cdf0e10cSrcweir 		throw uno::RuntimeException(); // TODO:
308cdf0e10cSrcweir 
309cdf0e10cSrcweir 	return xResult;
310cdf0e10cSrcweir }
311cdf0e10cSrcweir 
312cdf0e10cSrcweir //-------------------------------------------------------------------------
getImplementationName()313cdf0e10cSrcweir ::rtl::OUString SAL_CALL OleEmbeddedObjectFactory::getImplementationName()
314cdf0e10cSrcweir 	throw ( uno::RuntimeException )
315cdf0e10cSrcweir {
316cdf0e10cSrcweir 	return impl_staticGetImplementationName();
317cdf0e10cSrcweir }
318cdf0e10cSrcweir 
319cdf0e10cSrcweir //-------------------------------------------------------------------------
supportsService(const::rtl::OUString & ServiceName)320cdf0e10cSrcweir sal_Bool SAL_CALL OleEmbeddedObjectFactory::supportsService( const ::rtl::OUString& ServiceName )
321cdf0e10cSrcweir 	throw ( uno::RuntimeException )
322cdf0e10cSrcweir {
323cdf0e10cSrcweir 	uno::Sequence< ::rtl::OUString > aSeq = impl_staticGetSupportedServiceNames();
324cdf0e10cSrcweir 
325cdf0e10cSrcweir 	for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
326cdf0e10cSrcweir     	if ( ServiceName.compareTo( aSeq[nInd] ) == 0 )
327cdf0e10cSrcweir         	return sal_True;
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 	return sal_False;
330cdf0e10cSrcweir }
331cdf0e10cSrcweir 
332cdf0e10cSrcweir //-------------------------------------------------------------------------
getSupportedServiceNames()333cdf0e10cSrcweir uno::Sequence< ::rtl::OUString > SAL_CALL OleEmbeddedObjectFactory::getSupportedServiceNames()
334cdf0e10cSrcweir 	throw ( uno::RuntimeException )
335cdf0e10cSrcweir {
336cdf0e10cSrcweir 	return impl_staticGetSupportedServiceNames();
337cdf0e10cSrcweir }
338cdf0e10cSrcweir 
339