summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/ximpshap.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2006-03-06 12:41:58 +0000
committerRüdiger Timm <rt@openoffice.org>2006-03-06 12:41:58 +0000
commitfe669a0ec72da4681b555c22fe01b8c6f99dadd6 (patch)
treec58673daa4f04151e126a22850d070ff28eb5019 /xmloff/source/draw/ximpshap.cxx
parent02b82100bf566bf704abb959c51cb71e1a05a657 (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/source/draw/ximpshap.cxx')
-rw-r--r--xmloff/source/draw/ximpshap.cxx28
1 files changed, 25 insertions, 3 deletions
diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 6729c36f31c9..0606238d5705 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 );
}