From 8d9504231fafa38c0a564ad61e9287a3531b594c Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Mon, 7 Jul 2008 12:27:52 +0000 Subject: INTEGRATION: CWS impress146 (1.126.54); FILE MERGED 2008/06/26 10:59:42 cl 1.126.54.2: accept also xml:id for shape ids to support future ODF1.2 documents 2008/06/25 14:09:12 cl 1.126.54.1: #i91056# import shapes inside draw:a elements --- xmloff/source/draw/ximpshap.cxx | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 1fe00ced0380..81ab01fa5d82 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: ximpshap.cxx,v $ - * $Revision: 1.128 $ + * $Revision: 1.129 $ * * This file is part of OpenOffice.org. * @@ -34,6 +34,9 @@ #include +#include +#include +#include #include #include #include "unointerfacetouniqueidentifiermapper.hxx" @@ -99,6 +102,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::style; using namespace ::com::sun::star::container; +using namespace ::com::sun::star::document; using namespace ::xmloff::token; using namespace ::xmloff::EnhancedCustomShapeToken; @@ -372,6 +376,35 @@ void SdXMLShapeContext::EndElement() GetImport().GetTextImport()->_SetListItem( mxOldListItem ); } + if( msHyperlink.getLength() != 0 ) try + { + Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW ); + Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW ); + + uno::Sequence< beans::PropertyValue > aProperties( 3 ); + aProperties[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) ); + aProperties[0].Handle = -1; + aProperties[0].Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") ); + aProperties[0].State = beans::PropertyState_DIRECT_VALUE; + + aProperties[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ClickAction" ) ); + aProperties[1].Handle = -1; + aProperties[1].Value <<= ::com::sun::star::presentation::ClickAction_DOCUMENT; + aProperties[1].State = beans::PropertyState_DIRECT_VALUE; + + aProperties[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Bookmark" ) ); + aProperties[2].Handle = -1; + aProperties[2].Value <<= msHyperlink; + aProperties[2].State = beans::PropertyState_DIRECT_VALUE; + + const OUString sAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ); + xEvents->replaceByName( sAPIEventName, Any( aProperties ) ); + } + catch( Exception& ) + { + DBG_ERROR("xmloff::SdXMLShapeContext::EndElement(), exception caught!"); + } + if( mxLockable.is() ) mxLockable->removeActionLock(); } @@ -830,7 +863,7 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr maShapeDescription = rValue; } } - else if( XML_NAMESPACE_NONE == nPrefix ) + else if( (XML_NAMESPACE_NONE == nPrefix) || (XML_NAMESPACE_XML == nPrefix) ) { if( IsXMLToken( rLocalName, XML_ID ) ) { -- cgit