diff options
author | Michael Brauer <mib@openoffice.org> | 2001-03-16 11:46:48 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2001-03-16 11:46:48 +0000 |
commit | 522346ef0113ddc009e7790d9c5f4ae475067264 (patch) | |
tree | 18a8937b11dbe303dea082d654b2b78595777889 /svx/source/xml/xmleohlp.cxx | |
parent | 1165ac4fa622e63a042de9f703a2e3e40a28df61 (diff) |
All unkown OLE objects are SvOutplaceObjects
Diffstat (limited to 'svx/source/xml/xmleohlp.cxx')
-rw-r--r-- | svx/source/xml/xmleohlp.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index 649e30d83840..a8d269ffa357 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -2,7 +2,7 @@ * * $RCSfile: xmleohlp.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * last change: $Author: mib $ * @@ -71,6 +71,9 @@ #ifndef _PERSIST_HXX #include <so3/persist.hxx> #endif +#ifndef _FACTORY_HXX +#include <so3/factory.hxx> +#endif #ifndef _EMBOBJ_HXX #include <so3/embobj.hxx> #endif @@ -395,15 +398,29 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplReadObject( SvGlobalName aClassId; if( pClassId ) { + // If a class id is specifies, use it. aClassId = *pClassId; } else { + // Otherwise try to get one from the storage. For packages, the + // class id is derived from the package's mime type. The mime type + // is stored in the packages manifest and the manifest is read when + // the stoage is opened. Therfor, the class id is available without + // realy accessing the storage. SvStorageRef xObjStor( ImplGetObjectStorage( rContainerStorageName, aSrcObjName, sal_False ) ); aClassId = xObjStor->GetClassName(); } + // For all unkown class id, the OLE object has to be wrapped by an + // outplace object. + SvGlobalName aOutClassId( SO3_OUT_CLASSID ); + if( SvGlobalName() == aClassId || + ( aOutClassId != aClassId && + !SvFactory::IsIntern( aClassId, 0 ) ) ) + aClassId = SvGlobalName( aOutClassId ); + SvInfoObjectRef xInfo = new SvEmbeddedInfoObject( aObjName, aClassId ); mpDocPersist->Insert( xInfo ); |