diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-07-07 12:27:52 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-07-07 12:27:52 +0000 |
commit | 8d9504231fafa38c0a564ad61e9287a3531b594c (patch) | |
tree | 6ffe87b532b8916fdbfdcb24be8b90f76116942f /xmloff/source/draw | |
parent | 572382fdc287e7a9bd332e7335bd0b66be65ded2 (diff) |
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
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 37 |
1 files changed, 35 insertions, 2 deletions
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 <tools/debug.hxx> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/presentation/ClickAction.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/LineStyle.hpp> #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 ) ) { |