diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/inc/shapeexport.hxx xmloff/inc/shapeexport.hxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/inc/shapeexport.hxx	2005-09-09 14:08:00.000000000 +0100
+++ xmloff/inc/shapeexport.hxx	2006-06-19 12:18:00.000000000 +0100
@@ -70,6 +70,7 @@
 #ifndef _COM_SUN_STAR_AWT_POINT_HPP_
 #include <com/sun/star/awt/Point.hpp>
 #endif
+#include <com/sun/star/beans/PropertyValue.hpp>
 
 #include <map>
 
@@ -224,6 +225,9 @@ private:
 	const rtl::OUString							msStartShape;
 	const rtl::OUString							msEndShape;
 	const rtl::OUString							msOnClick;
+	const rtl::OUString							msOnAction;
+	const rtl::OUString							msAction;
+	const rtl::OUString							msURL;
 	const rtl::OUString							msEventType;
 	const rtl::OUString							msPresentation;
 	const rtl::OUString							msMacroName;
@@ -249,6 +253,7 @@ private:
 	SAL_DLLPRIVATE sal_Bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const rtl::OUString& rClass );
 	SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
 	SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
+	SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::beans::PropertyValue* pProps, const sal_Int32 nCount );
 	SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
 
 	// single shape exporters
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/eventimp.cxx xmloff/source/draw/eventimp.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/eventimp.cxx	2005-09-09 14:44:06.000000000 +0100
+++ xmloff/source/draw/eventimp.cxx	2006-06-19 12:19:16.000000000 +0100
@@ -132,7 +132,10 @@ class SdXMLEventContext : public SvXMLIm
 {
 private:
 	com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
-
+	void processPresentationEvents( const Reference< XNameReplace >& ); 
+	// Action & OnClick
+	void processShapeEvents( const Reference< XNameReplace >& ); 
+	void fillMacroEventProps( beans::PropertyValue*& ); 
 public:
 	TYPEINFO();
 
@@ -144,10 +147,12 @@ public:
 
 	sal_Bool mbValid;
 	sal_Bool mbScript;
+	sal_Bool mbShapeAction;
 	ClickAction meClickAction;
 	XMLEffect meEffect;
 	XMLEffectDirection meDirection;
 	sal_Int16 mnStartScale;
+	sal_Int16 mnPrfx;
 	AnimationSpeed meSpeed;
 	sal_Int32 mnVerb;
 	OUString msSoundURL;
@@ -155,6 +160,7 @@ public:
 	OUString msMacroName;
 	OUString msBookmark;
 	OUString msLanguage;
+	OUString msHyperURL;
 };
 
 ///////////////////////////////////////////////////////////////////////
@@ -207,7 +213,7 @@ XMLEventSoundContext::~XMLEventSoundCont
 {
 }
 
-///////////////////////////////////////////////////////////////////////
+/////////HyperURL
 
 TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
 
@@ -215,13 +221,19 @@ SdXMLEventContext::SdXMLEventContext( Sv
 :	SvXMLImportContext(rImp, nPrfx, rLocalName),
 	mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
 	meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
-	meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
+	meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False ), mnPrfx( nPrfx ), mbShapeAction( sal_False )
 {
-	const OUString msXMLEventName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
+	static const OUString msXMLEventName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
+	static const OUString msXMLShapeAction( RTL_CONSTASCII_USTRINGPARAM( "action" ) );
 
-	if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
+	if( nPrfx == XML_NAMESPACE_PRESENTATION  && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
+	{
+		mbValid = sal_True;
+	}
+	else if( nPrfx == XML_NAMESPACE_DRAW  && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
 	{
 		mbValid = sal_True;
+		mbShapeAction = sal_True;
 	}
 	else if( nPrfx == XML_NAMESPACE_SCRIPT && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
 	{
@@ -288,7 +300,7 @@ SdXMLEventContext::SdXMLEventContext( Sv
 				sEventName = sValue;
 				sal_uInt16 nScriptPrefix = 
 					GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
-				mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == msXMLEventName;
+				mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == msXMLEventName | sEventName == msXMLShapeAction );
 			}
 			else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
 			{
@@ -314,16 +326,19 @@ SdXMLEventContext::SdXMLEventContext( Sv
 			if( IsXMLToken( aAttrLocalName, XML_HREF ) )
 			{
 				if ( mbScript )
-				{
 					msMacroName = sValue;
-				}
 				else
 				{
-					const rtl::OUString &rTmp = 
-						rImp.GetAbsoluteReference(sValue);
-					INetURLObject::translateToInternal( rTmp, msBookmark, 
-						INetURLObject::DECODE_UNAMBIGUOUS, 
-						RTL_TEXTENCODING_UTF8 );
+					if ( !mbShapeAction )
+					{
+						const rtl::OUString &rTmp = 
+							rImp.GetAbsoluteReference(sValue);
+						INetURLObject::translateToInternal( rTmp, msBookmark, 
+							INetURLObject::DECODE_UNAMBIGUOUS, 
+							RTL_TEXTENCODING_UTF8 );
+					}
+					else
+						msHyperURL = sValue;	
 				}
 			}
 			break;
@@ -344,31 +359,166 @@ SvXMLImportContext * SdXMLEventContext::
 	return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this );
 }
 
-void SdXMLEventContext::EndElement()
+void  SdXMLEventContext::fillMacroEventProps( beans::PropertyValue*& pProperties)
 {
-	const OUString msAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
+	pProperties->Name =
+			OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
+	pProperties->Handle = -1;
+	pProperties->Value <<= OUString(
+		RTL_CONSTASCII_USTRINGPARAM("Script") );
+	pProperties->State = beans::PropertyState_DIRECT_VALUE;
+	pProperties++;
+
+	pProperties->Name = OUString(
+		RTL_CONSTASCII_USTRINGPARAM( "Script" ) );
+	pProperties->Handle = -1;
+	pProperties->Value <<= msMacroName;
+	pProperties->State = beans::PropertyState_DIRECT_VALUE;
+}
 
-	if( !mbValid )
+void  SdXMLEventContext::processShapeEvents( const Reference< XNameReplace >& xEvents )
+{
+	OUString sAPIEventName;
+	if ( mbShapeAction )
+		sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ));
+	else if ( mbScript )
+		sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ));
+	else
+		return;
+	if( !xEvents->hasByName( sAPIEventName ) )
 		return;
 
-	do
+	uno::Sequence< beans::PropertyValue > aProperties( 2 );
+	beans::PropertyValue* pProperties = aProperties.getArray();
+
+	if ( mbShapeAction )
 	{
-		Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
-		if( !xEventsSupplier.is() )
-			break;
+		pProperties->Name =
+			OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
+		pProperties->Handle = -1;
+		pProperties->Value <<= OUString(
+			RTL_CONSTASCII_USTRINGPARAM("Action") );
+		pProperties->State = beans::PropertyState_DIRECT_VALUE;
+		pProperties++;
+
+		pProperties->Name = OUString(
+			RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
+		pProperties->Handle = -1;
+		pProperties->Value <<= msHyperURL;
+		pProperties->State = beans::PropertyState_DIRECT_VALUE;
+	}
+	else
+		fillMacroEventProps( pProperties );
+	uno::Any aAny;
+	aAny <<= aProperties;
+	xEvents->replaceByName( sAPIEventName, aAny );
+}
+void  SdXMLEventContext::processPresentationEvents( const Reference< XNameReplace >& xEvents )
+{
+	const OUString sAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
+	if( !xEvents->hasByName( sAPIEventName ) )
+		return;
 
-		Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
-		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
-		if( !xEvents.is() )
-			break;
+	sal_Int32 nPropertyCount = 2;
+	switch( meClickAction )
+	{
+	case ClickAction_NONE:
+	case ClickAction_PREVPAGE:
+	case ClickAction_NEXTPAGE:
+	case ClickAction_FIRSTPAGE:
+	case ClickAction_LASTPAGE:
+	case ClickAction_INVISIBLE:
+	case ClickAction_STOPPRESENTATION:
+		break;
+	case ClickAction_PROGRAM:
+	case ClickAction_VERB:
+	case ClickAction_BOOKMARK:
+	case ClickAction_DOCUMENT:
+		nPropertyCount += 1;
+		break;
+	case ClickAction_MACRO:
+		if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
+			nPropertyCount += 1;
+		break;
 
-		if( !xEvents->hasByName( msAPIEventName ) )
-			break;
+	case ClickAction_SOUND:
+		nPropertyCount += 2;
+		break;
+
+	case ClickAction_VANISH:
+		nPropertyCount += 4;
+		break;
+	default:
+		break;
+	}
 
-		if( mbScript )
-			meClickAction = ClickAction_MACRO;
+	uno::Sequence< beans::PropertyValue > aProperties( nPropertyCount );
+	beans::PropertyValue* pProperties = aProperties.getArray();
+
+	if( ClickAction_MACRO == meClickAction )
+	{
+		if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
+		{
+			OUString sLibrary;
+			const OUString& rApp = GetXMLToken( XML_APPLICATION ); 
+			const OUString& rDoc = GetXMLToken( XML_DOCUMENT ); 
+			if( msMacroName.getLength() > rApp.getLength()+1 &&
+				msMacroName.copy(0,rApp.getLength()).equalsIgnoreAsciiCase( rApp ) &&
+				':' == msMacroName[rApp.getLength()] )
+			{
+				sLibrary = OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice"));
+				msMacroName = msMacroName.copy( rApp.getLength()+1 );
+			}
+			else if( msMacroName.getLength() > rDoc.getLength()+1 &&
+				msMacroName.copy(0,rDoc.getLength()).equalsIgnoreAsciiCase( rDoc ) &&
+				':' == msMacroName[rDoc.getLength()] )
+			{
+				sLibrary = rDoc;
+				msMacroName = msMacroName.copy( rDoc.getLength()+1 );
+			}
+
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
+			pProperties->Handle = -1;
+			pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("StarBasic") );
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
+			pProperties++;
+
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ) );
+			pProperties->Handle = -1;
+			pProperties->Value <<= msMacroName;
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
+			pProperties++;
+
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Library" ) );
+			pProperties->Handle = -1;
+			pProperties->Value <<= sLibrary;
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
+		}
+		else
+			fillMacroEventProps( pProperties );
+	}
+	else
+	{
+		pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
+		pProperties->Handle = -1;
+		pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
+		pProperties->State = beans::PropertyState_DIRECT_VALUE;
+		pProperties++;
+
+		// ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event
+		// so check here if its realy a bookmark or maybe a document
+		if( meClickAction == ClickAction_BOOKMARK )
+		{
+			if( msBookmark.compareToAscii( "#", 1 ) != 0 )
+				meClickAction = ClickAction_DOCUMENT;
+		}
+
+		pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ClickAction") );
+		pProperties->Handle = -1;
+		pProperties->Value <<= meClickAction;
+		pProperties->State = beans::PropertyState_DIRECT_VALUE;
+		pProperties++;
 
-		sal_Int32 nPropertyCount = 2;
 		switch( meClickAction )
 		{
 		case ClickAction_NONE:
@@ -379,179 +527,91 @@ void SdXMLEventContext::EndElement()
 		case ClickAction_INVISIBLE:
 		case ClickAction_STOPPRESENTATION:
 			break;
-		case ClickAction_PROGRAM:
-		case ClickAction_VERB:
+
 		case ClickAction_BOOKMARK:
-		case ClickAction_DOCUMENT:
-			nPropertyCount += 1;
-			break;
-		case ClickAction_MACRO:
-			if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
-				nPropertyCount += 1;
-			break;
+			msBookmark = msBookmark.copy(1);
 
-		case ClickAction_SOUND:
-			nPropertyCount += 2;
+			// Note: no break here!!!
+
+		case ClickAction_DOCUMENT:
+		case ClickAction_PROGRAM:
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Bookmark") );
+			pProperties->Handle = -1;
+			pProperties->Value <<= msBookmark;
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
 			break;
 
 		case ClickAction_VANISH:
-			nPropertyCount += 4;
-			break;
-		default:
-			break;
-		}
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Effect") );
+			pProperties->Handle = -1;
+			pProperties->Value <<= ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, sal_True );
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
+			pProperties++;
 
-		uno::Sequence< beans::PropertyValue > aProperties( nPropertyCount );
-		beans::PropertyValue* pProperties = aProperties.getArray();
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Speed") );
+			pProperties->Handle = -1;
+			pProperties->Value <<= meSpeed;
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
+			pProperties++;
 
-		if( ClickAction_MACRO == meClickAction )
-		{
-			if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
-			{
-				OUString sLibrary;
-				const OUString& rApp = GetXMLToken( XML_APPLICATION ); 
-				const OUString& rDoc = GetXMLToken( XML_DOCUMENT ); 
-				if( msMacroName.getLength() > rApp.getLength()+1 &&
-					msMacroName.copy(0,rApp.getLength()).equalsIgnoreAsciiCase( rApp ) &&
-					':' == msMacroName[rApp.getLength()] )
-				{
-					sLibrary = OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice"));
-					msMacroName = msMacroName.copy( rApp.getLength()+1 );
-				}
-				else if( msMacroName.getLength() > rDoc.getLength()+1 &&
-					msMacroName.copy(0,rDoc.getLength()).equalsIgnoreAsciiCase( rDoc ) &&
-					':' == msMacroName[rDoc.getLength()] )
-				{
-					sLibrary = rDoc;
-					msMacroName = msMacroName.copy( rDoc.getLength()+1 );
-				}
+			// NOTE: no break here!!!
 
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
-				pProperties->Handle = -1;
-				pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("StarBasic") );
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				pProperties++;
-
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ) );
-				pProperties->Handle = -1;
-				pProperties->Value <<= msMacroName;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				pProperties++;
-
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Library" ) );
-				pProperties->Handle = -1;
-				pProperties->Value <<= sLibrary;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-			}
-			else
-			{
-				pProperties->Name =
-					OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
-				pProperties->Handle = -1;
-				pProperties->Value <<= OUString(
-					RTL_CONSTASCII_USTRINGPARAM("Script") );
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				pProperties++;
-
-				pProperties->Name = OUString(
-					RTL_CONSTASCII_USTRINGPARAM( "Script" ) );
-				pProperties->Handle = -1;
-				pProperties->Value <<= msMacroName;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-			}
-		}
-		else
-		{
-			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
+		case ClickAction_SOUND:
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("SoundURL") );
 			pProperties->Handle = -1;
-			pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
+			pProperties->Value <<= msSoundURL;
 			pProperties->State = beans::PropertyState_DIRECT_VALUE;
 			pProperties++;
 
-			// ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event
-			// so check here if its realy a bookmark or maybe a document
-			if( meClickAction == ClickAction_BOOKMARK )
-			{
-				if( msBookmark.compareToAscii( "#", 1 ) != 0 )
-					meClickAction = ClickAction_DOCUMENT;
-			}
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PlayFull") );
+			pProperties->Handle = -1;
+			pProperties->Value = ::cppu::bool2any(mbPlayFull);
+			pProperties->State = beans::PropertyState_DIRECT_VALUE;
+			break;
 
-			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ClickAction") );
+		case ClickAction_VERB:
+			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Verb") );
 			pProperties->Handle = -1;
-			pProperties->Value <<= meClickAction;
+			pProperties->Value <<= mnVerb;
 			pProperties->State = beans::PropertyState_DIRECT_VALUE;
-			pProperties++;
+			break;
+		}
+	}
+	uno::Any aAny;
+	aAny <<= aProperties;
+	xEvents->replaceByName( sAPIEventName, aAny );
 
-			switch( meClickAction )
-			{
-			case ClickAction_NONE:
-			case ClickAction_PREVPAGE:
-			case ClickAction_NEXTPAGE:
-			case ClickAction_FIRSTPAGE:
-			case ClickAction_LASTPAGE:
-			case ClickAction_INVISIBLE:
-			case ClickAction_STOPPRESENTATION:
-				break;
+}
+void SdXMLEventContext::EndElement()
+{
+
+	if( !mbValid )
+		return;
 
-			case ClickAction_BOOKMARK:
-				msBookmark = msBookmark.copy(1);
+	do
+	{
+		Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
+		if( !xEventsSupplier.is() )
+			break;
 
-				// Note: no break here!!!
+		Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
+		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
+		if( !xEvents.is() )
+			break;
 
-			case ClickAction_DOCUMENT:
-			case ClickAction_PROGRAM:
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Bookmark") );
-				pProperties->Handle = -1;
-				pProperties->Value <<= msBookmark;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
+		switch( mnPrfx )
+		{
+			case XML_NAMESPACE_PRESENTATION:
+				processPresentationEvents( xEvents );	
 				break;
-
-			case ClickAction_VANISH:
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Effect") );
-				pProperties->Handle = -1;
-				pProperties->Value <<= ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, sal_True );
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				pProperties++;
-
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Speed") );
-				pProperties->Handle = -1;
-				pProperties->Value <<= meSpeed;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				pProperties++;
-
-				// NOTE: no break here!!!
-
-			case ClickAction_SOUND:
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("SoundURL") );
-				pProperties->Handle = -1;
-				pProperties->Value <<= msSoundURL;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				pProperties++;
-
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PlayFull") );
-				pProperties->Handle = -1;
-				pProperties->Value = ::cppu::bool2any(mbPlayFull);
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
+			case XML_NAMESPACE_DRAW:
+			case XML_NAMESPACE_SCRIPT:
+				processShapeEvents( xEvents );
 				break;
-
-			case ClickAction_VERB:
-				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Verb") );
-				pProperties->Handle = -1;
-				pProperties->Value <<= mnVerb;
-				pProperties->State = beans::PropertyState_DIRECT_VALUE;
-				break;
-			case ClickAction_MACRO:
-				DBG_ERROR("xmloff::SdXMLEventContext::EndElement(), ClickAction_MACRO must be handled in different if case");
-				break;
 			default:
 				break;
-			}
 		}
 
-		uno::Any aAny;
-		aAny <<= aProperties;
-		xEvents->replaceByName( msAPIEventName, aAny );
-
 	} while(0);
 }
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport2.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/shapeexport2.cxx	2006-04-26 15:10:26.000000000 +0100
+++ xmloff/source/draw/shapeexport2.cxx	2006-06-19 12:19:23.000000000 +0100
@@ -352,272 +352,302 @@ void XMLShapeExport::ImpExportText( cons
 #define FOUND_EVENTTYPE		0x0080
 #define FOUND_MACRO			0x0100
 #define FOUND_LIBRARY		0x0200
+#define FOUND_ACTION		0x0400
 
-void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& xShape )
+void XMLShapeExport::ImpExportEvents( const beans::PropertyValue* pProperties, const sal_Int32 nCount )
 {
-	do
+	sal_Int32 nFound = 0;
+	OUString aStrEventType;
+	presentation::ClickAction eClickAction;
+	presentation::AnimationEffect eEffect;
+	presentation::AnimationSpeed eSpeed;
+	OUString aStrSoundURL;
+	sal_Bool bPlayFull = false;
+	sal_Int32 nVerb;
+	OUString aStrMacro;
+	OUString aStrLibrary;
+	OUString aStrBookmark;
+	OUString aHyperURL;
+	sal_Int32 nIndex;
+	for( nIndex = 0; nIndex < nCount; nIndex++, pProperties++ )
 	{
-		uno::Reference< document::XEventsSupplier > xEventsSupplier( xShape, uno::UNO_QUERY );
-		if( !xEventsSupplier.is() )
-			break;
+		if( ( ( nFound & FOUND_EVENTTYPE ) == 0 ) && pProperties->Name == msEventType )
+		{
+			if( pProperties->Value >>= aStrEventType )
+				nFound |= FOUND_EVENTTYPE;
+		}
+		else if( ( ( nFound & FOUND_CLICKACTION ) == 0 ) && pProperties->Name == msClickAction )
+		{
+			if( pProperties->Value >>= eClickAction )
+				nFound |= FOUND_CLICKACTION;
+		}
+		else if( ( ( nFound & FOUND_MACRO ) == 0 ) && ( pProperties->Name == msMacroName || pProperties->Name == msScript ) )
+		{
+			if( pProperties->Value >>= aStrMacro )
+				nFound |= FOUND_MACRO;
+		}
+		else if( ( ( nFound & FOUND_ACTION ) == 0 ) && ( pProperties->Name == msURL  ) )
+		{
+			if( pProperties->Value >>= aHyperURL )
+				nFound |= FOUND_ACTION;
+		}
+		else if( ( ( nFound & FOUND_LIBRARY ) == 0 ) && pProperties->Name == msLibrary )
+		{
+			if( pProperties->Value >>= aStrLibrary )
+				nFound |= FOUND_LIBRARY;
+		}
+		else if( ( ( nFound & FOUND_EFFECT ) == 0 ) && pProperties->Name == msEffect )
+		{
+			if( pProperties->Value >>= eEffect )
+				nFound |= FOUND_EFFECT;
+		}
+		else if( ( ( nFound & FOUND_BOOKMARK ) == 0 ) && pProperties->Name == msBookmark )
+		{
+			if( pProperties->Value >>= aStrBookmark )
+				nFound |= FOUND_BOOKMARK;
+		}
+		else if( ( ( nFound & FOUND_SPEED ) == 0 ) && pProperties->Name == msSpeed )
+		{
+			if( pProperties->Value >>= eSpeed )
+				nFound |= FOUND_SPEED;
+		}
+		else if( ( ( nFound & FOUND_SOUNDURL ) == 0 ) && pProperties->Name == msSoundURL )
+		{
+			if( pProperties->Value >>= aStrSoundURL )
+				nFound |= FOUND_SOUNDURL;
+		}
+		else if( ( ( nFound & FOUND_PLAYFULL ) == 0 ) && pProperties->Name == msPlayFull )
+		{
+			if( pProperties->Value >>= bPlayFull )
+				nFound |= FOUND_PLAYFULL;
+		}
+		else if( ( ( nFound & FOUND_VERB ) == 0 ) && pProperties->Name == msVerb )
+		{
+			if( pProperties->Value >>= nVerb )
+				nFound |= FOUND_VERB;
+		}
+	}
 
-		uno::Reference< container::XNameReplace > xEvents( xEventsSupplier->getEvents() );
-		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
-		if( !xEvents.is() )
-			break;
+	if( ( nFound & FOUND_EVENTTYPE ) == 0 )
+		return;
 
-		uno::Sequence< beans::PropertyValue > aProperties;
-		if( !xEvents->hasByName( msOnClick ) )
-			break;
+	if( aStrEventType == msPresentation )
+	{
+		if( ( nFound & FOUND_CLICKACTION ) == 0 )
+			return;
 
-		if( !(xEvents->getByName( msOnClick ) >>= aProperties) )
-			break;
+		if( eClickAction == presentation::ClickAction_NONE )
+			return;
 
-		sal_Int32 nFound = 0;
-		const beans::PropertyValue* pProperties = aProperties.getConstArray();
+		SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
 
-		OUString aStrEventType;
-		presentation::ClickAction eClickAction;
-		presentation::AnimationEffect eEffect;
-		presentation::AnimationSpeed eSpeed;
-		OUString aStrSoundURL;
-		sal_Bool bPlayFull = false;
-		sal_Int32 nVerb;
-		OUString aStrMacro;
-		OUString aStrLibrary;
-		OUString aStrBookmark;
+		enum XMLTokenEnum eStrAction;
 
-		const sal_Int32 nCount = aProperties.getLength();
-		sal_Int32 nIndex;
-		for( nIndex = 0; nIndex < nCount; nIndex++, pProperties++ )
+		switch( eClickAction )
 		{
-			if( ( ( nFound & FOUND_EVENTTYPE ) == 0 ) && pProperties->Name == msEventType )
-			{
-				if( pProperties->Value >>= aStrEventType )
-					nFound |= FOUND_EVENTTYPE;
-			}
-			else if( ( ( nFound & FOUND_CLICKACTION ) == 0 ) && pProperties->Name == msClickAction )
-			{
-				if( pProperties->Value >>= eClickAction )
-					nFound |= FOUND_CLICKACTION;
-			}
-			else if( ( ( nFound & FOUND_MACRO ) == 0 ) && ( pProperties->Name == msMacroName || pProperties->Name == msScript ) )
-			{
-				if( pProperties->Value >>= aStrMacro )
-					nFound |= FOUND_MACRO;
-			}
-			else if( ( ( nFound & FOUND_LIBRARY ) == 0 ) && pProperties->Name == msLibrary )
-			{
-				if( pProperties->Value >>= aStrLibrary )
-					nFound |= FOUND_LIBRARY;
-			}
-			else if( ( ( nFound & FOUND_EFFECT ) == 0 ) && pProperties->Name == msEffect )
-			{
-				if( pProperties->Value >>= eEffect )
-					nFound |= FOUND_EFFECT;
-			}
-			else if( ( ( nFound & FOUND_BOOKMARK ) == 0 ) && pProperties->Name == msBookmark )
-			{
-				if( pProperties->Value >>= aStrBookmark )
-					nFound |= FOUND_BOOKMARK;
-			}
-			else if( ( ( nFound & FOUND_SPEED ) == 0 ) && pProperties->Name == msSpeed )
-			{
-				if( pProperties->Value >>= eSpeed )
-					nFound |= FOUND_SPEED;
-			}
-			else if( ( ( nFound & FOUND_SOUNDURL ) == 0 ) && pProperties->Name == msSoundURL )
-			{
-				if( pProperties->Value >>= aStrSoundURL )
-					nFound |= FOUND_SOUNDURL;
-			}
-			else if( ( ( nFound & FOUND_PLAYFULL ) == 0 ) && pProperties->Name == msPlayFull )
-			{
-				if( pProperties->Value >>= bPlayFull )
-					nFound |= FOUND_PLAYFULL;
-			}
-			else if( ( ( nFound & FOUND_VERB ) == 0 ) && pProperties->Name == msVerb )
-			{
-				if( pProperties->Value >>= nVerb )
-					nFound |= FOUND_VERB;
-			}
+		case presentation::ClickAction_PREVPAGE:		eStrAction = XML_PREVIOUS_PAGE; break;
+		case presentation::ClickAction_NEXTPAGE:		eStrAction = XML_NEXT_PAGE; break;
+		case presentation::ClickAction_FIRSTPAGE:		eStrAction = XML_FIRST_PAGE; break;
+		case presentation::ClickAction_LASTPAGE:		eStrAction = XML_LAST_PAGE; break;
+		case presentation::ClickAction_INVISIBLE:		eStrAction = XML_HIDE; break;
+		case presentation::ClickAction_STOPPRESENTATION:eStrAction = XML_STOP; break;
+		case presentation::ClickAction_PROGRAM:			eStrAction = XML_EXECUTE; break;
+		case presentation::ClickAction_BOOKMARK:		eStrAction = XML_SHOW; break;
+		case presentation::ClickAction_DOCUMENT:		eStrAction = XML_SHOW; break;
+		case presentation::ClickAction_MACRO:			eStrAction = XML_EXECUTE_MACRO; break;
+		case presentation::ClickAction_VERB:			eStrAction = XML_VERB; break;
+		case presentation::ClickAction_VANISH:			eStrAction = XML_FADE_OUT; break;
+		case presentation::ClickAction_SOUND:			eStrAction = XML_SOUND; break;
+		default:
+			DBG_ERROR( "unknown presentation::ClickAction found!" );
+			eStrAction = XML_UNKNOWN;
 		}
 
-		if( ( nFound & FOUND_EVENTTYPE ) == 0 )
-			break;
+		OUString aEventQName(
+			mrExport.GetNamespaceMap().GetQNameByKey(
+					XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
+		mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
+		mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_ACTION, eStrAction );
 
-		if( aStrEventType == msPresentation )
+		if( eClickAction == presentation::ClickAction_VANISH )
 		{
-			if( ( nFound & FOUND_CLICKACTION ) == 0 )
-				break;
+			if( nFound & FOUND_EFFECT )
+			{
+				XMLEffect eKind;
+				XMLEffectDirection eDirection;
+				sal_Int16 nStartScale;
+				sal_Bool bIn;
 
-			if( eClickAction == presentation::ClickAction_NONE )
-				break;
+				SdXMLImplSetEffect( eEffect, eKind, eDirection, nStartScale, bIn );
 
-			SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
+				if( eKind != EK_none )
+				{
+					SvXMLUnitConverter::convertEnum( msBuffer, eKind, aXML_AnimationEffect_EnumMap );
+					mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_EFFECT, msBuffer.makeStringAndClear() );
+				}
 
-			enum XMLTokenEnum eStrAction;
+				if( eDirection != ED_none )
+				{
+					SvXMLUnitConverter::convertEnum( msBuffer, eDirection, aXML_AnimationDirection_EnumMap );
+					mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_DIRECTION, msBuffer.makeStringAndClear() );
+				}
 
-			switch( eClickAction )
-			{
-			case presentation::ClickAction_PREVPAGE:		eStrAction = XML_PREVIOUS_PAGE; break;
-			case presentation::ClickAction_NEXTPAGE:		eStrAction = XML_NEXT_PAGE; break;
-			case presentation::ClickAction_FIRSTPAGE:		eStrAction = XML_FIRST_PAGE; break;
-			case presentation::ClickAction_LASTPAGE:		eStrAction = XML_LAST_PAGE; break;
-			case presentation::ClickAction_INVISIBLE:		eStrAction = XML_HIDE; break;
-			case presentation::ClickAction_STOPPRESENTATION:eStrAction = XML_STOP; break;
-			case presentation::ClickAction_PROGRAM:			eStrAction = XML_EXECUTE; break;
-			case presentation::ClickAction_BOOKMARK:		eStrAction = XML_SHOW; break;
-			case presentation::ClickAction_DOCUMENT:		eStrAction = XML_SHOW; break;
-			case presentation::ClickAction_MACRO:			eStrAction = XML_EXECUTE_MACRO; break;
-			case presentation::ClickAction_VERB:			eStrAction = XML_VERB; break;
-			case presentation::ClickAction_VANISH:			eStrAction = XML_FADE_OUT; break;
-			case presentation::ClickAction_SOUND:			eStrAction = XML_SOUND; break;
-			default:
-				DBG_ERROR( "unknown presentation::ClickAction found!" );
-				eStrAction = XML_UNKNOWN;
+				if( nStartScale != -1 )
+				{
+					SvXMLUnitConverter::convertPercent( msBuffer, nStartScale );
+					mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, msBuffer.makeStringAndClear() );
+				}
 			}
 
-			OUString aEventQName(
-				mrExport.GetNamespaceMap().GetQNameByKey(
-						XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
-			mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
-			mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_ACTION, eStrAction );
-
-			if( eClickAction == presentation::ClickAction_VANISH )
+			if( nFound & FOUND_SPEED && eEffect != presentation::AnimationEffect_NONE )
 			{
-				if( nFound & FOUND_EFFECT )
+				if( eSpeed != presentation::AnimationSpeed_MEDIUM )
 				{
-					XMLEffect eKind;
-					XMLEffectDirection eDirection;
-					sal_Int16 nStartScale;
-					sal_Bool bIn;
-
-					SdXMLImplSetEffect( eEffect, eKind, eDirection, nStartScale, bIn );
+					SvXMLUnitConverter::convertEnum( msBuffer, eSpeed, aXML_AnimationSpeed_EnumMap );
+					mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, msBuffer.makeStringAndClear() );
+				}
+			}
+		}
 
-					if( eKind != EK_none )
-					{
-						SvXMLUnitConverter::convertEnum( msBuffer, eKind, aXML_AnimationEffect_EnumMap );
-						mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_EFFECT, msBuffer.makeStringAndClear() );
-					}
+		if( eClickAction == presentation::ClickAction_PROGRAM ||
+			eClickAction == presentation::ClickAction_BOOKMARK ||
+			eClickAction == presentation::ClickAction_DOCUMENT )
+		{
+			if( eClickAction == presentation::ClickAction_BOOKMARK )
+				msBuffer.append( sal_Unicode('#') );
 
-					if( eDirection != ED_none )
-					{
-						SvXMLUnitConverter::convertEnum( msBuffer, eDirection, aXML_AnimationDirection_EnumMap );
-						mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_DIRECTION, msBuffer.makeStringAndClear() );
-					}
+			msBuffer.append( aStrBookmark );
+			mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(msBuffer.makeStringAndClear()) );
+			mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
+			mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
+			mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
+		}
 
-					if( nStartScale != -1 )
-					{
-						SvXMLUnitConverter::convertPercent( msBuffer, nStartScale );
-						mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, msBuffer.makeStringAndClear() );
-					}
-				}
+		if( ( nFound & FOUND_VERB ) && eClickAction == presentation::ClickAction_VERB )
+		{
+			msBuffer.append( nVerb );
+			mrExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_VERB, msBuffer.makeStringAndClear());
+		}
 
-				if( nFound & FOUND_SPEED && eEffect != presentation::AnimationEffect_NONE )
-				{
-					if( eSpeed != presentation::AnimationSpeed_MEDIUM )
-					{
-						SvXMLUnitConverter::convertEnum( msBuffer, eSpeed, aXML_AnimationSpeed_EnumMap );
-						mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, msBuffer.makeStringAndClear() );
-					}
-				}
-			}
+		SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
 
-			if( eClickAction == presentation::ClickAction_PROGRAM ||
-				eClickAction == presentation::ClickAction_BOOKMARK ||
-				eClickAction == presentation::ClickAction_DOCUMENT )
+		if( eClickAction == presentation::ClickAction_VANISH || eClickAction == presentation::ClickAction_SOUND )
+		{
+			if( ( nFound & FOUND_SOUNDURL ) && aStrSoundURL.getLength() != 0 )
 			{
-				if( eClickAction == presentation::ClickAction_BOOKMARK )
-					msBuffer.append( sal_Unicode('#') );
-
-				msBuffer.append( aStrBookmark );
-				mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(msBuffer.makeStringAndClear()) );
+				mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStrSoundURL) );
 				mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
 				mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
 				mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
-			}
+				if( nFound & FOUND_PLAYFULL && bPlayFull )
+					mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PLAY_FULL, XML_TRUE );
 
-			if( ( nFound & FOUND_VERB ) && eClickAction == presentation::ClickAction_VERB )
-			{
-				msBuffer.append( nVerb );
-				mrExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_VERB, msBuffer.makeStringAndClear());
+				SvXMLElementExport aElem( mrExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
 			}
+		}
+	}
+	else if( aStrEventType == msStarBasic )
+	{
+		if( nFound & FOUND_MACRO )
+		{
+			SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
 
-			SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
+			mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, 
+						mrExport.GetNamespaceMap().GetQNameByKey(
+						 	XML_NAMESPACE_OOO, 
+						 	OUString( RTL_CONSTASCII_USTRINGPARAM( 
+											"starbasic" ) ) ) );
+			OUString aEventQName(
+				mrExport.GetNamespaceMap().GetQNameByKey(
+						XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
+			mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
 
-			if( eClickAction == presentation::ClickAction_VANISH || eClickAction == presentation::ClickAction_SOUND )
+			if( nFound & FOUND_LIBRARY )
 			{
-				if( ( nFound & FOUND_SOUNDURL ) && aStrSoundURL.getLength() != 0 )
-				{
-					mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStrSoundURL) );
-					mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
-					mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
-					mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
-					if( nFound & FOUND_PLAYFULL && bPlayFull )
-						mrExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PLAY_FULL, XML_TRUE );
-
-					SvXMLElementExport aElem( mrExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
-				}
+				OUString sLocation( GetXMLToken(
+					(aStrLibrary.equalsIgnoreAsciiCaseAscii("StarOffice") ||
+				 	 aStrLibrary.equalsIgnoreAsciiCaseAscii("application") ) ? XML_APPLICATION
+														   			   : XML_DOCUMENT ) );
+				OUStringBuffer sTmp( sLocation.getLength() + aStrMacro.getLength() + 1 );
+				sTmp = sLocation;
+				sTmp.append( sal_Unicode( ':' ) );
+				sTmp.append( aStrMacro );
+				mrExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME,
+									 sTmp.makeStringAndClear());
 			}
-			break;
+			else
+			{
+				mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, aStrMacro );
+			}
+
+
+			SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
 		}
-		else if( aStrEventType == msStarBasic )
+	}
+	else if( aStrEventType == msScript || aStrEventType == msAction )
+	{
+		if( nFound & ( FOUND_MACRO | FOUND_ACTION ) )
 		{
-			if( nFound & FOUND_MACRO )
+			SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
+			if ( nFound & FOUND_MACRO )
 			{
-				SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
-
-				mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, 
-							mrExport.GetNamespaceMap().GetQNameByKey(
-							 	XML_NAMESPACE_OOO, 
-							 	OUString( RTL_CONSTASCII_USTRINGPARAM( 
-												"starbasic" ) ) ) );
+				mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, mrExport.GetNamespaceMap().GetQNameByKey(
+						 XML_NAMESPACE_OOO, GetXMLToken(XML_SCRIPT) ) );
 				OUString aEventQName(
 					mrExport.GetNamespaceMap().GetQNameByKey(
 							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
 				mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
-
-				if( nFound & FOUND_LIBRARY )
-				{
-					OUString sLocation( GetXMLToken(
-						(aStrLibrary.equalsIgnoreAsciiCaseAscii("StarOffice") ||
-					 	 aStrLibrary.equalsIgnoreAsciiCaseAscii("application") ) ? XML_APPLICATION
-															   			   : XML_DOCUMENT ) );
-					OUStringBuffer sTmp( sLocation.getLength() + aStrMacro.getLength() + 1 );
-					sTmp = sLocation;
-					sTmp.append( sal_Unicode( ':' ) );
-					sTmp.append( aStrMacro );
-					mrExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME,
-										 sTmp.makeStringAndClear());
-				}
-				else
-				{
-					mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, aStrMacro );
-				}
-
+				mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStrMacro );
 
 				SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
 			}
-		}
-		else if( aStrEventType == msScript )
-		{
-			if( nFound & FOUND_MACRO )
+			if ( nFound & FOUND_ACTION )
 			{
-				SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
-
 				mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, mrExport.GetNamespaceMap().GetQNameByKey(
-							 XML_NAMESPACE_OOO, GetXMLToken(XML_SCRIPT) ) );
+						 XML_NAMESPACE_OOO, GetXMLToken(XML_SCRIPT) ) );
 				OUString aEventQName(
 					mrExport.GetNamespaceMap().GetQNameByKey(
-							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
+							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) );
 				mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
-				mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStrMacro );
+				mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL );
 
-				SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
+				SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_DRAW, XML_EVENT_LISTENER, sal_True, sal_True);
 			}
 		}
 	}
+}
+
+void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& xShape )
+{
+	do
+	{
+		uno::Reference< document::XEventsSupplier > xEventsSupplier( xShape, uno::UNO_QUERY );
+		if( !xEventsSupplier.is() )
+			break;
+
+		uno::Reference< container::XNameReplace > xEvents( xEventsSupplier->getEvents() );
+		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
+		if( !xEvents.is() )
+			break;
+
+		static uno::Sequence< OUString > aEvents = xEvents->getElementNames();
+		const OUString* pEvt = aEvents.getConstArray();
+		const OUString* pEnd = aEvents.getConstArray() + aEvents.getLength();
+
+		for ( ; pEvt != pEnd; ++pEvt )
+		{
+			uno::Sequence< beans::PropertyValue > aProperties;
+			if( !xEvents->hasByName( *pEvt ) )
+				break;
+
+			if( !(xEvents->getByName( *pEvt ) >>= aProperties) )
+				break;
+			const beans::PropertyValue* pProperties = aProperties.getConstArray();
+			const sal_Int32 nCount = aProperties.getLength();
+			ImpExportEvents( pProperties, nCount );
+		}
+
+	}
 	while(0);
 }
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/shapeexport.cxx xmloff/source/draw/shapeexport.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/shapeexport.cxx	2006-03-27 11:04:25.000000000 +0100
+++ xmloff/source/draw/shapeexport.cxx	2006-06-19 12:18:00.000000000 +0100
@@ -158,6 +158,9 @@ XMLShapeExport::XMLShapeExport(SvXMLExpo
 	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
 	msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
 	msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
+	msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ),
+	msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ),
+	msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ),
 	msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
 	msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
 	msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/inc/sc.hrc sc/inc/sc.hrc
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/inc/sc.hrc	2006-06-24 11:21:52.000000000 +0100
+++ sc/inc/sc.hrc	2006-06-24 12:17:58.000000000 +0100
@@ -574,6 +574,9 @@
 // additional IDs for list/range validity
 #define FID_VALID_LISTTYPE              (SC_VIEW_START + 93)
 #define SID_ASSIGNMACRO			(SC_VIEW_START + 94)
+#define SID_EDITLNK_ATTR_DLG	(SC_VIEW_START + 95)
+#define SID_DELLNK	(SC_VIEW_START + 96)
+#define SID_OPENLNK	(SC_VIEW_START + 97)
 
 // Nachrichten -------------------------------------------------------------
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/inc/userdat.hxx sc/inc/userdat.hxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/inc/userdat.hxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/inc/userdat.hxx	2006-06-24 12:19:39.000000000 +0100
@@ -108,6 +108,7 @@ public:
 class ScMacroInfo : public SdrObjUserData
 {
 	rtl::OUString sMacro;
+	rtl::OUString sHlink;
 public:
 					ScMacroInfo();
 	virtual			~ScMacroInfo();
@@ -115,7 +116,9 @@ public:
 	virtual	SdrObjUserData* Clone( SdrObject* pObj ) const;
 
 	void 	SetMacro( const rtl::OUString& rMacro )	{ sMacro = rMacro; }
+	void 	SetHlink( const rtl::OUString& rHlink )	{ sHlink = rHlink; }
 	const rtl::OUString&	GetMacro() const				{ return sMacro; }
+	const rtl::OUString&	GetHlink() const				{ return sHlink; }
 };
 
 #endif
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/sdi/drawsh.sdi sc/sdi/drawsh.sdi
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/sdi/drawsh.sdi	2006-06-24 11:21:52.000000000 +0100
+++ sc/sdi/drawsh.sdi	2006-06-24 14:01:42.000000000 +0100
@@ -228,6 +228,9 @@ interface TableDraw
 	SID_FONTWORK_CHARACTER_SPACING			[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
 	SID_FONTWORK_KERN_CHARACTER_PAIRS		[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
     SID_FONTWORK_CHARACTER_SPACING_DIALOG	[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
+	SID_EDITLNK_ATTR_DLG	[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
+	SID_DELLNK	[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
+	SID_OPENLNK	[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
 }
 
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/sdi/scalc.sdi sc/sdi/scalc.sdi
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/sdi/scalc.sdi	2006-06-24 11:21:52.000000000 +0100
+++ sc/sdi/scalc.sdi	2006-06-24 12:25:15.000000000 +0100
@@ -6822,6 +6822,81 @@ SfxVoidItem TableSelectAll FID_TAB_SELEC
 ]
 
 //--------------------------------------------------------------------------
+SfxVoidItem EditHyper SID_EDITLNK_ATTR_DLG
+()
+[
+	/* flags: */
+	AutoUpdate = FALSE,
+	Cachable = Cachable,
+	FastCall = TRUE,
+	HasCoreId = FALSE,
+	HasDialog = TRUE,
+	ReadOnlyDoc = TRUE,
+	Toggle = FALSE,
+	Container = FALSE,
+	RecordAbsolute = FALSE,
+	RecordPerSet;
+	Synchron;
+
+	/* config: */
+	AccelConfig = TRUE,
+	MenuConfig = FALSE,
+	StatusBarConfig = FALSE,
+	ToolBoxConfig = FALSE,
+	GroupId = GID_DRAWING;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem DelHlink SID_DELLNK
+()
+[
+	/* flags: */
+	AutoUpdate = TRUE,
+	Cachable = Cachable,
+	FastCall = TRUE,
+	HasCoreId = FALSE,
+	HasDialog = FALSE,
+	ReadOnlyDoc = TRUE,
+	Toggle = FALSE,
+	Container = FALSE,
+	RecordAbsolute = FALSE,
+	RecordPerSet;
+	Synchron;
+	
+	/* config: */
+	AccelConfig = TRUE,
+	MenuConfig = FALSE,
+	StatusBarConfig = FALSE,
+	ToolBoxConfig = FALSE,
+	GroupId = GID_DRAWING;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem OpenHlink SID_OPENLNK
+()
+[
+	/* flags: */
+	AutoUpdate = TRUE,
+	Cachable = Cachable,
+	FastCall = TRUE,
+	HasCoreId = FALSE,
+	HasDialog = FALSE,
+	ReadOnlyDoc = TRUE,
+	Toggle = FALSE,
+	Container = FALSE,
+	RecordAbsolute = FALSE,
+	RecordPerSet;
+	Synchron;
+	
+	/* config: */
+	AccelConfig = TRUE,
+	MenuConfig = FALSE,
+	StatusBarConfig = FALSE,
+	ToolBoxConfig = FALSE,
+	GroupId = GID_DRAWING;
+]
+
+//--------------------------------------------------------------------------
 SfxVoidItem TextAttributes SID_DRAWTEXT_ATTR_DLG
 ()
 [
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/excel/xicontent.cxx sc/source/filter/excel/xicontent.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/excel/xicontent.cxx	2006-06-23 15:46:18.000000000 +0100
+++ sc/source/filter/excel/xicontent.cxx	2006-06-24 12:19:39.000000000 +0100
@@ -281,16 +281,25 @@ void lclInsertUrl( const XclImpRoot& rRo
 void XclImpHyperlink::ReadHlink( XclImpStream& rStrm )
 {
     const XclImpRoot& rRoot = rStrm.GetRoot();
+    XclRange aXclRange( ScAddress::UNINITIALIZED );
+    rStrm >> aXclRange; 
+    String aString =  ReadHlinkRecord( rStrm );
+
+    if ( aString.Len() )
+        rRoot.GetXFRangeBuffer().SetHyperlink( aXclRange, aString );
+}
+
+String XclImpHyperlink::ReadHlinkRecord( XclImpStream& rStrm )
+{
     DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 );
 
+    const XclImpRoot& rRoot = rStrm.GetRoot();
     ScDocument& rDoc = rRoot.GetDoc();
     SfxObjectShell* pDocShell = rRoot.GetDocShell();
 
-    XclRange aXclRange( ScAddress::UNINITIALIZED );
     sal_uInt32 nFlags;
     XclGuid aGuid;
-
-    rStrm >> aXclRange >> aGuid;
+    rStrm >> aGuid;
     rStrm.Ignore( 4 );
     rStrm >> nFlags;
 
@@ -384,8 +393,9 @@ void XclImpHyperlink::ReadHlink( XclImpS
             xLongName->Append( '#' );
             xLongName->Append( *xTextMark );
         }
-        rRoot.GetXFRangeBuffer().SetHyperlink( aXclRange, *xLongName );
+        return *xLongName;
     }
+    return String();
 }
 
 void XclImpHyperlink::InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl )
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/excel/xiescher.cxx sc/source/filter/excel/xiescher.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/excel/xiescher.cxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/filter/excel/xiescher.cxx	2006-06-24 12:19:39.000000000 +0100
@@ -1387,30 +1387,34 @@ SdrObject* XclImpDffManager::ProcessObj(
     /*  Connect textbox data (string, alignment, text orientation) to object.
         #98132# don't ask for a text-ID, Escher export doesn't set one. */
     XclImpDrawingObj* pDrawingObj = dynamic_cast< XclImpDrawingObj* >( xDrawObj.get() );
+
     if( pDrawingObj )
         pDrawingObj->SetTxoData( mrObjManager.FindTxoData( rObjData.rSpHd ) );
 
+    // Generic shape bits hyper & macro
+    if ( xSdrObj.get() )
+    {
+        String sHlinkURL = ReadHlinkProperty( rEscherStrm );
+        if ( sHlinkURL.Len() )
+        {
+            ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE );
+            if ( pInfo )
+                pInfo->SetHlink( sHlinkURL );
+        }
+        if ( xDrawObj->GetMacroName().Len() )
+        {
+            ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE );
+            if ( pInfo )
+                pInfo->SetMacro( XclTbxControlHelper::GetScMacroName( xDrawObj->GetMacroName() ) );
+        }
+    }
     // #118052# import internal name of a control
     if( XclImpOleObj* pOleObj = dynamic_cast< XclImpOleObj* >( xDrawObj.get() ) )
     {
         String aName( ReadStringProperty( rEscherStrm, DFF_Prop_wzName ) );
         if( aName.Len() )
             pOleObj->SetControlName( aName );
-    }
-    else
-    {
-        // its a drawing object or form control
-        if ( pDrawingObj && xSdrObj.get() )
-        {
-            if ( pDrawingObj->GetMacroName().Len() ) // has associated macro
-            {
-                ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE );
-		DBG_ASSERT( pInfo, "shape macro info could not be created!" );
-
-                if ( pInfo )
-                    pInfo->SetMacro( XclTbxControlHelper::GetScMacroName(pDrawingObj->GetMacroName() ) );
-            }
-        }
+	
     }
 
     // try to create a custom SdrObject that overwrites the passed object
@@ -1479,6 +1483,32 @@ FASTBOOL XclImpDffManager::GetColorFromP
 }
 
 // private --------------------------------------------------------------------
+String XclImpDffManager::ReadHlinkProperty( SvStream& rEscherStrm ) const
+{
+    String aString;
+    sal_uInt32 nPropId = DFF_Prop_pihlShape;
+    sal_uInt32 nBufferSize = GetPropertyValue( nPropId );
+    if( (nBufferSize > 0) && SeekToContent( nPropId, rEscherStrm ) )
+    {
+        const static sal_uInt16 nDummyId = 9999;
+	sal_uInt16 nRecSize = nBufferSize;
+        SvMemoryStream memStream;
+        
+        memStream << nDummyId;
+        memStream << nRecSize; 	
+        for ( sal_Int32 nByteCount = 0; nByteCount < nRecSize; ++nByteCount )
+        {
+            sal_uInt8 aByte = 0;
+            rEscherStrm >> aByte;
+            memStream << aByte;
+        }
+        XclImpStream aLinkStream( memStream, GetRoot() );
+        aLinkStream.StartNextRecord();
+        XclImpHyperlink aHlink;
+        aString = aHlink.ReadHlinkRecord( aLinkStream );
+    }
+    return aString;
+}
 
 String XclImpDffManager::ReadStringProperty( SvStream& rEscherStrm, sal_uInt32 nPropId ) const
 {
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/inc/xicontent.hxx sc/source/filter/inc/xicontent.hxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/inc/xicontent.hxx	2006-06-23 15:46:18.000000000 +0100
+++ sc/source/filter/inc/xicontent.hxx	2006-06-24 12:19:39.000000000 +0100
@@ -98,6 +98,7 @@ public:
     /** Reads a HLINK record and inserts it into the document.
         @descr  Import stream must be located at start of a HLINK record. */
     static void         ReadHlink( XclImpStream& rStrm );
+    static String       ReadHlinkRecord( XclImpStream& rStrm );
 
     /** Inserts the URL into a range of cells. Does not modify value or formula cells. */
     static void         InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl );
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh2.cxx	2006-06-23 15:46:18.000000000 +0100
+++ sc/source/ui/drawfunc/drawsh2.cxx	2006-06-24 13:39:04.000000000 +0100
@@ -76,6 +76,8 @@
 #ifndef _SVDCAPT_HXX
 #include <svx/svdocapt.hxx>
 #endif
+#include "drwlayer.hxx"
+#include "userdat.hxx"
 
 USHORT ScGetFontWorkId();		// in drtxtob
 
@@ -209,9 +211,21 @@ void ScDrawShell::GetDrawFuncState( SfxI
 	}
 
 	BOOL bCanRename = FALSE;
+	if ( nMarkCount > 1 ) // no hypelink options for a selected group
+	{
+		rSet.DisableItem( SID_EDITLNK_ATTR_DLG );
+		rSet.DisableItem( SID_DELLNK );
+		rSet.DisableItem( SID_OPENLNK );
+	}
 	if ( nMarkCount == 1 )
 	{
         SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
+	ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
+	if ( !pInfo || ( pInfo &&  pInfo->GetHlink().getLength() == 0 ) )
+	{
+		rSet.DisableItem( SID_DELLNK );
+		rSet.DisableItem( SID_OPENLNK );
+	}
         SdrLayerID nLayerID = pObj->GetLayer();
         if ( nLayerID != SC_LAYER_INTERN )
             bCanRename = TRUE;                          // #i51351# anything except internal objects can be renamed
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh5.cxx sc/source/ui/drawfunc/drawsh5.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh5.cxx	2006-06-23 15:46:18.000000000 +0100
+++ sc/source/ui/drawfunc/drawsh5.cxx	2006-06-24 11:56:43.000000000 +0100
@@ -105,6 +105,12 @@ void ScDrawShell::GetHLinkState( SfxItem
     {
         SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
         SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
+        ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
+        if ( pInfo && pInfo->GetHlink().getLength() )
+        {
+            aHLinkItem.SetURL( pInfo->GetHlink() );
+            aHLinkItem.SetInsertMode(HLINK_FIELD);
+        }
         if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
         {
             uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
@@ -183,13 +189,15 @@ void ScDrawShell::ExecuteHLink( SfxReque
                     SvxLinkInsertMode eMode = pHyper->GetInsertMode();
 
                     BOOL bDone = FALSE;
-                    if ( eMode == HLINK_DEFAULT || eMode == HLINK_BUTTON )
+                    if ( eMode == HLINK_FIELD || eMode == HLINK_BUTTON )
                     {
                         ScDrawView* pView = pViewData->GetScDrawView();
                         const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
                         if ( rMarkList.GetMarkCount() == 1 )
                         {
-                            SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetMarkedSdrObj());
+                            SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+
+                            SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj );
                             if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
                             {
                                 uno::Reference<awt::XControlModel> xControlModel =
@@ -239,6 +247,12 @@ void ScDrawShell::ExecuteHLink( SfxReque
                                     bDone = TRUE;
                                 }
                             }
+                            else
+                            {
+                                SetHlinkForObject( pObj, rURL );
+                                bDone = TRUE;
+                            }
+ 
                         }
                     }
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh.cxx sc/source/ui/drawfunc/drawsh.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh.cxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/ui/drawfunc/drawsh.cxx	2006-06-24 12:02:18.000000000 +0100
@@ -294,6 +294,8 @@
 #include <sfx2/app.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/request.hxx>
+#include <sfx2/dispatch.hxx>
+
 #include <svtools/whiter.hxx>
 #include <vcl/msgbox.hxx>
 
@@ -467,6 +469,41 @@ void ScDrawShell::ExecDrawAttr( SfxReque
 		case SID_DRAWTEXT_ATTR_DLG:
 			ExecuteTextAttrDlg( rReq );
 			break;
+		case SID_EDITLNK_ATTR_DLG:
+			{
+				if ( pSingleSelectedObj )
+					pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
+				break;
+			}
+		case SID_DELLNK:
+			{
+				if ( pSingleSelectedObj )
+					SetHlinkForObject( pSingleSelectedObj, rtl::OUString() );
+				break;
+			}
+		case SID_OPENLNK:
+			{
+				if ( nMarkCount == 1 )
+				{
+					SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();	
+
+					if ( pObj->IsGroupObject() )
+					{
+						SdrPageView* pPV = NULL;
+						SdrObject* pHit = NULL;
+						if ( pView->PickObj( pWin->PixelToLogic( pViewData->GetMousePosPixel() ), pHit, pPV, SDRSEARCH_DEEP ) ) 
+							pObj = pHit;
+					}					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
+					if ( pInfo && pInfo->GetHlink().getLength() )
+					{
+						rtl::OUString sURL = pInfo->GetHlink();
+						rtl::OUString  sTarget = sURL;
+						ScGlobal::OpenURL( sURL, sTarget );
+					}
+	
+				}
+				break;
+			}
 
 		case SID_ATTR_TRANSFORM:
 			{
@@ -702,4 +732,14 @@ void ScDrawShell::ExecuteTextAttrDlg( Sf
 	delete( pDlg );
 }
 
+void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
+{
+	if ( !pObj )
+		return;
+	ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
+	pInfo->SetHlink( rHlnk );
+	lcl_setModified( GetObjectShell() );
+}
+
+
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/fudraw.cxx sc/source/ui/drawfunc/fudraw.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/fudraw.cxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/ui/drawfunc/fudraw.cxx	2006-06-24 12:04:38.000000000 +0100
@@ -894,10 +894,8 @@ void FuDraw::ForcePointer(const MouseEve
 			SdrObjMacroHitRec aHitRec;	//! muss da noch irgendwas gesetzt werden ????
 			pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
 		}
-		else  if ( !bAlt && pInfo && pInfo->GetMacro().getLength() )
-		{
+		else  if ( !bAlt && pInfo && pInfo->GetMacro().getLength() | pInfo->GetHlink().getLength() )
 			pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
-		}	
 		else if ( IsDetectiveHit( aPnt ) )
 			pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
 		else
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/fusel.cxx sc/source/ui/drawfunc/fusel.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/fusel.cxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/ui/drawfunc/fusel.cxx	2006-06-24 12:09:27.000000000 +0100
@@ -191,9 +191,11 @@ BOOL __EXPORT FuSelection::MouseButtonDo
 			else
 			{
 
+				String sURL;
+				String sTarget;
+
 				if ( !bAlt && pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER))
 				{
-
 					// Support for imported Excel docs
 					// Excel is of course not consistent and allows
 					// a hyperlink to be assigned for an object group
@@ -218,7 +220,16 @@ BOOL __EXPORT FuSelection::MouseButtonDo
 					}
 
 					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
-					if ( pInfo->GetMacro().getLength() )
+
+					// For interoperability favour links over 
+					// macros if both are defined
+					if ( pInfo->GetHlink().getLength() )
+					{
+						OSL_TRACE("** Got URL");
+						sURL = pInfo->GetHlink();
+						sTarget = sURL;
+					}
+					else if ( pInfo->GetMacro().getLength() )
 					{
 						SfxObjectShell* pObjSh = SfxObjectShell::Current();
 						if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
@@ -237,6 +248,7 @@ BOOL __EXPORT FuSelection::MouseButtonDo
 					}
 				}
 
+
 				//	URL / ImageMap
 
 				SdrViewEvent aVEvt;
@@ -250,16 +262,21 @@ BOOL __EXPORT FuSelection::MouseButtonDo
 								ScDrawLayer::GetHitIMapObject( aVEvt.pObj, aMDPos, *pWindow );
 						if ( pIMapObj && pIMapObj->GetURL().Len() )
 						{
-							ScGlobal::OpenURL( pIMapObj->GetURL(), pIMapObj->GetTarget() );
+							sURL = pIMapObj->GetURL();
+							sTarget =  pIMapObj->GetTarget();
 
-							pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
-							return TRUE;		// kein CaptureMouse etc.
 						}
 					}
 					if ( aVEvt.eEvent == SDREVENT_EXECUTEURL && aVEvt.pURLField )	// URL
 					{
-						ScGlobal::OpenURL( aVEvt.pURLField->GetURL(),
-											aVEvt.pURLField->GetTargetFrame() );
+						sURL = aVEvt.pURLField->GetURL();
+						sTarget = aVEvt.pURLField->GetTargetFrame();
+
+					}
+
+					if ( sURL.Len() )
+					{
+						ScGlobal::OpenURL( sURL, sTarget );
 
 						pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
 						return TRUE;		// kein CaptureMouse etc.
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/objdraw.src sc/source/ui/drawfunc/objdraw.src
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/objdraw.src	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/ui/drawfunc/objdraw.src	2006-06-24 13:46:44.000000000 +0100
@@ -200,6 +200,42 @@
         ITEM_FORMAT_PARA_DLG\
     };
 
+#define MN_EDITLNK \
+    MenuItem\
+    {\
+        Identifier = SID_EDITLNK_ATTR_DLG ; \
+        HelpID = SID_EDITLNK_ATTR_DLG ; \
+        Text [ de ] = "~Hyperlink..." ; \
+        Text [ en-US ] = "~Hyperlink..." ; \
+        Text [ cs ] = "Hypertextový odkaz..." ; \
+        Text [ sk ] = "Odkaz" ; \
+		Text [ x-comment ] = " ";\
+	};
+
+#define MN_DELLNK \
+    MenuItem\
+    {\
+        Identifier = SID_DELLNK ; \
+        HelpID = SID_DELLNK ; \
+        Text [ de ] = "~Remove Hyperlink" ; \
+        Text [ en-US ] = "~Remove Hyperlink" ; \
+        Text [ cs ] = "Odstraň hypertextový odkaz" ; \
+        Text [ sk ] = "Odstrániť odkaz" ; \
+		Text [ x-comment ] = " ";\
+	};
+
+#define MN_OPENLNK \
+    MenuItem\
+    {\
+        Identifier = SID_OPENLNK ; \
+        HelpID = SID_OPENLNK ; \
+        Text [ de ] = "~Open Hyperlink" ; \
+        Text [ en-US ] = "~Open Hyperlink" ; \
+        Text [ cs ] = "Otevři hypertextový odkaz" ; \
+        Text [ sk ] = "Otvoriť odkaz" ; \
+		Text [ x-comment ] = " ";\
+	};
+
 #define MN_DRWTXTATTR \
     MenuItem\
     {\
@@ -400,6 +430,7 @@
 		Text [ x-comment ] = " ";\
 	};
 
+
  //
  //	------------------------------------------------------------------------------
  //
@@ -1295,6 +1326,12 @@ Menu RID_POPUP_DRAW
 		MenuItem { Separator = TRUE ; };
 		 //------------------------------
 		ITEM_GROUP_MENU
+		 //------------------------------
+		MenuItem { Separator = TRUE ; };
+		 //------------------------------
+		MN_EDITLNK // Edit H~yperlink...
+		MN_DELLNK  // ~Remove Hyperlink
+		MN_OPENLNK  // ~Open Hyperlink
 	};
 };
 
@@ -1348,6 +1385,12 @@ Menu RID_POPUP_GRAPHIC
 		MenuItem { Separator = TRUE ; };
 		 //------------------------------
 		ITEM_GROUP_MENU
+		 //------------------------------
+		MenuItem { Separator = TRUE ; };
+		 //------------------------------
+		MN_EDITLNK // Edit H~yperlink...
+		MN_DELLNK  // ~Remove Hyperlink
+		MN_OPENLNK  // ~Open Hyperlink
 	   };
 };
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/inc/drawsh.hxx sc/source/ui/inc/drawsh.hxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/inc/drawsh.hxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/ui/inc/drawsh.hxx	2006-06-24 12:16:52.000000000 +0100
@@ -61,6 +61,7 @@ class ScDrawShell : public SfxShell
 	ScViewData*	pViewData;
 
     DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
+    void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
 
 protected:
 	ScViewData*	GetViewData()	{ return pViewData; }
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/unoobj/shapeuno.cxx sc/source/ui/unoobj/shapeuno.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/unoobj/shapeuno.cxx	2006-06-24 11:21:52.000000000 +0100
+++ sc/source/ui/unoobj/shapeuno.cxx	2006-06-24 12:19:39.000000000 +0100
@@ -1342,16 +1342,20 @@ SdrObject* ScShapeObj::GetSdrObject() co
 
 typedef ::cppu::WeakImplHelper1< container::XNameReplace > ShapeUnoEventAcess_BASE;
 const rtl::OUString sOnClick = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OnClick") );
+const rtl::OUString sOnAction = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OnAction") );
+const rtl::OUString sURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("URL") );
+const rtl::OUString sAction = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Action") );
 const rtl::OUString sStrScript = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Script") );
 const rtl::OUString sEventType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("EventType") );
 
+const rtl::OUString sEventNames[] = { sOnClick, sOnAction };
 class ShapeUnoEventAccessImpl : public ShapeUnoEventAcess_BASE
 {
 
 	ScShapeObj* mpShape;	
 	bool isValidName( const rtl::OUString& aName )
 	{
-		return ( aName == sOnClick );
+		return ( aName == sOnClick | aName == sOnAction );
 	}
 	
 	ScMacroInfo* getInfo( BOOL bCreate = false )
@@ -1390,7 +1394,7 @@ public:
 				isEventType = true;
 				continue;
 			}
-			if ( isEventType &&  pProperties->Name == sStrScript )
+			if ( isEventType && ( pProperties->Name == sStrScript | pProperties->Name == sURL) )
 			{
 				rtl::OUString sValue;
 				if ( ! ( pProperties->Value >>= sValue ) )
@@ -1400,7 +1404,10 @@ public:
 				
 				if ( !pInfo )
 					break;	
-				pInfo->SetMacro( sValue );	
+				if ( pProperties->Name == sStrScript )
+					pInfo->SetMacro( sValue );	
+				else
+					pInfo->SetHlink( sValue );
 			}	
 
 		}
@@ -1415,21 +1422,34 @@ public:
 		ScMacroInfo* pInfo = getInfo();
 		uno::Sequence< beans::PropertyValue > aProperties;
 		if ( pInfo )
-		{
-			if ( pInfo->GetMacro().getLength() )
+			if ( aName == sOnClick )
 			{
-				aProperties.realloc(2);
-				aProperties[ 0 ].Name = sEventType;
-				aProperties[ 0 ].Value <<= sStrScript;
-				aProperties[ 1 ].Name = sStrScript;
-				aProperties[ 1 ].Value <<= pInfo->GetMacro();	
+				if ( pInfo->GetMacro().getLength() )
+				{
+					aProperties.realloc(2);
+					aProperties[ 0 ].Name = sEventType;
+					aProperties[ 0 ].Value <<= sStrScript;
+					aProperties[ 1 ].Name = sStrScript;
+					aProperties[ 1 ].Value <<= pInfo->GetMacro();	
+				}
 			}
+			else
+			{
+				if ( pInfo->GetHlink().getLength() )	
+				{
+					aProperties.realloc(2);
+					aProperties[ 0 ].Name = sEventType;
+					aProperties[ 0 ].Value <<= sAction;
+					aProperties[ 1 ].Name = sURL;
+					aProperties[ 1 ].Value <<= pInfo->GetHlink();	
+				}
+				
 		}
 		return uno::makeAny( aProperties );
 	}
 	virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames(  ) throw(uno::RuntimeException)
 	{
-		uno::Sequence< rtl::OUString > aStr( &sOnClick, 1 );
+		uno::Sequence< rtl::OUString > aStr( sEventNames, 2 );
 		return aStr;
 	}
 
diff -rup /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/view/gridwin5.cxx sc/source/ui/view/gridwin5.cxx
--- /data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/view/gridwin5.cxx	2006-06-23 15:46:18.000000000 +0100
+++ sc/source/ui/view/gridwin5.cxx	2006-06-24 12:19:39.000000000 +0100
@@ -84,6 +84,7 @@
 #include "chgviset.hxx"
 #include "dbfunc.hxx"
 #include "tabvwsh.hxx"
+#include "userdat.hxx"
 
 
 // -----------------------------------------------------------------------
@@ -340,6 +341,27 @@ void __EXPORT ScGridWindow::RequestHelp(
 						aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
 					}
 				}
+				SdrObject* pObj = NULL;
+				SdrPageView* pPV = NULL;
+				Point aMDPos = PixelToLogic( aPosPixel );
+				if ( pDrView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER) )
+				{
+					if ( pObj->IsGroupObject() )
+					{
+							SdrObject* pHit = NULL;
+							if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
+								pObj = pHit;
+					}
+					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );	
+					if ( pInfo && pInfo->GetHlink().getLength() )
+					{
+						aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
+						aHelpText = pInfo->GetHlink();
+						
+					}	
+						
+
+				}
 				// URL in Textobjekt
 				if ( !aHelpText.Len() && aVEvt.eEvent == SDREVENT_EXECUTEURL )
 				{
