diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2006-03-06 12:41:58 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2006-03-06 12:41:58 +0000 |
commit | 47314d49165993a691950b1a04fe625d8103b48a (patch) | |
tree | 5c4530c12390b78df5b0a6175c75d7c9a2e487bb /xmloff | |
parent | 64d0de7d3ae4de74d0ed7977caf3ade5e61c1fed (diff) |
INTEGRATION: CWS swqbf56 (1.108.6); FILE MERGED
2006/03/02 13:28:53 od 1.108.6.2: RESYNC: (1.108-1.109); FILE MERGED
2006/03/02 12:34:10 od 1.108.6.1: #b6382898# <SdXMLShapeContext::AddShape( const char* )
- The Writer model (XTextDocument) no longer support service
com.sun.star.drawing.OLE2Shape since fix for issue i33294.
To handle Draw OLE objects in Writer documents it has been
decided to import these as OLE object convert them after
the import into graphic objects.
Thus, if service com.sun.star.drawing.OLE2Shape is requested
for a Writer document, use temporary service name
com.sun.star.drawing.temporaryForXMLImportOLE2Shape to
retrieve such a service from the Writer model.
The conversion into graphic objects is performed after the
intrinsic XML import.
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 052093003d..ba36ce9f6b 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -4,9 +4,9 @@ * * $RCSfile: ximpshap.cxx,v $ * - * $Revision: 1.109 $ + * $Revision: 1.110 $ * - * last change: $Author: kz $ $Date: 2006-02-27 16:35:02 $ + * last change: $Author: rt $ $Date: 2006-03-06 13:41:58 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -203,6 +203,12 @@ #include "xmlerror.hxx" #endif +// --> OD 2006-02-22 #b6382898# +#ifndef _COM_SUN_STAR_TEXT_XTEXTDOCUMENT_HPP_ +#include <com/sun/star/text/XTextDocument.hpp> +#endif +// <-- + using namespace ::rtl; using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -539,7 +545,23 @@ void SdXMLShapeContext::AddShape(const char* pServiceName ) { try { - uno::Reference< drawing::XShape > xShape(xServiceFact->createInstance(OUString::createFromAscii(pServiceName)), uno::UNO_QUERY); + // --> OD 2006-02-22 #b6382898# + // Since fix for issue i33294 the Writer model doesn't support + // com.sun.star.drawing.OLE2Shape anymore. + // To handle Draw OLE objects it's decided to import these + // objects as com.sun.star.drawing.OLE2Shape and convert these + // objects after the import into com.sun.star.drawing.GraphicObjectShape. + uno::Reference< drawing::XShape > xShape; + if ( OUString::createFromAscii(pServiceName).compareToAscii( "com.sun.star.drawing.OLE2Shape" ) == 0 && + uno::Reference< text::XTextDocument >(GetImport().GetModel(), uno::UNO_QUERY).is() ) + { + xShape = uno::Reference< drawing::XShape >(xServiceFact->createInstance(OUString::createFromAscii("com.sun.star.drawing.temporaryForXMLImportOLE2Shape")), uno::UNO_QUERY); + } + else + { + xShape = uno::Reference< drawing::XShape >(xServiceFact->createInstance(OUString::createFromAscii(pServiceName)), uno::UNO_QUERY); + } + // <-- if( xShape.is() ) AddShape( xShape ); } |