View | Details | Raw Unified | Return to issue 66550
Collapse All | Expand All

(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/inc/shapeexport.hxx (+5 lines)
Lines 70-75 Link Here
70
#ifndef _COM_SUN_STAR_AWT_POINT_HPP_
70
#ifndef _COM_SUN_STAR_AWT_POINT_HPP_
71
#include <com/sun/star/awt/Point.hpp>
71
#include <com/sun/star/awt/Point.hpp>
72
#endif
72
#endif
73
#include <com/sun/star/beans/PropertyValue.hpp>
73
74
74
#include <map>
75
#include <map>
75
76
Lines 224-229 private: Link Here
224
	const rtl::OUString							msStartShape;
225
	const rtl::OUString							msStartShape;
225
	const rtl::OUString							msEndShape;
226
	const rtl::OUString							msEndShape;
226
	const rtl::OUString							msOnClick;
227
	const rtl::OUString							msOnClick;
228
	const rtl::OUString							msOnAction;
229
	const rtl::OUString							msAction;
230
	const rtl::OUString							msURL;
227
	const rtl::OUString							msEventType;
231
	const rtl::OUString							msEventType;
228
	const rtl::OUString							msPresentation;
232
	const rtl::OUString							msPresentation;
229
	const rtl::OUString							msMacroName;
233
	const rtl::OUString							msMacroName;
Lines 249-254 private: Link Here
249
	SAL_DLLPRIVATE sal_Bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const rtl::OUString& rClass );
253
	SAL_DLLPRIVATE sal_Bool ImpExportPresentationAttributes( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet >& xPropSet, const rtl::OUString& rClass );
250
	SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
254
	SAL_DLLPRIVATE void ImpExportText( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
251
	SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
255
	SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
256
	SAL_DLLPRIVATE void ImpExportEvents( const com::sun::star::beans::PropertyValue* pProps, const sal_Int32 nCount );
252
	SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
257
	SAL_DLLPRIVATE void ImpExportGluePoints( const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape );
253
258
254
	// single shape exporters
259
	// single shape exporters
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/eventimp.cxx (-172 / +239 lines)
Lines 132-138 class SdXMLEventContext : public SvXMLIm Link Here
132
{
132
{
133
private:
133
private:
134
	com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
134
	com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape;
135
135
	void processPresentationEvents( const Reference< XNameReplace >& ); 
136
	// Action & OnClick
137
	void processShapeEvents( const Reference< XNameReplace >& ); 
138
	void fillMacroEventProps( beans::PropertyValue*& ); 
136
public:
139
public:
137
	TYPEINFO();
140
	TYPEINFO();
138
141
Lines 144-153 public: Link Here
144
147
145
	sal_Bool mbValid;
148
	sal_Bool mbValid;
146
	sal_Bool mbScript;
149
	sal_Bool mbScript;
150
	sal_Bool mbShapeAction;
147
	ClickAction meClickAction;
151
	ClickAction meClickAction;
148
	XMLEffect meEffect;
152
	XMLEffect meEffect;
149
	XMLEffectDirection meDirection;
153
	XMLEffectDirection meDirection;
150
	sal_Int16 mnStartScale;
154
	sal_Int16 mnStartScale;
155
	sal_Int16 mnPrfx;
151
	AnimationSpeed meSpeed;
156
	AnimationSpeed meSpeed;
152
	sal_Int32 mnVerb;
157
	sal_Int32 mnVerb;
153
	OUString msSoundURL;
158
	OUString msSoundURL;
Lines 155-160 public: Link Here
155
	OUString msMacroName;
160
	OUString msMacroName;
156
	OUString msBookmark;
161
	OUString msBookmark;
157
	OUString msLanguage;
162
	OUString msLanguage;
163
	OUString msHyperURL;
158
};
164
};
159
165
160
///////////////////////////////////////////////////////////////////////
166
///////////////////////////////////////////////////////////////////////
Lines 207-213 XMLEventSoundContext::~XMLEventSoundCont Link Here
207
{
213
{
208
}
214
}
209
215
210
///////////////////////////////////////////////////////////////////////
216
/////////HyperURL
211
217
212
TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
218
TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
213
219
Lines 215-227 SdXMLEventContext::SdXMLEventContext( Sv Link Here
215
:	SvXMLImportContext(rImp, nPrfx, rLocalName),
221
:	SvXMLImportContext(rImp, nPrfx, rLocalName),
216
	mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
222
	mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
217
	meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
223
	meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
218
	meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
224
	meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False ), mnPrfx( nPrfx ), mbShapeAction( sal_False )
219
{
225
{
220
	const OUString msXMLEventName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
226
	static const OUString msXMLEventName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
227
	static const OUString msXMLShapeAction( RTL_CONSTASCII_USTRINGPARAM( "action" ) );
221
228
222
	if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
229
	if( nPrfx == XML_NAMESPACE_PRESENTATION  && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
230
	{
231
		mbValid = sal_True;
232
	}
233
	else if( nPrfx == XML_NAMESPACE_DRAW  && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
223
	{
234
	{
224
		mbValid = sal_True;
235
		mbValid = sal_True;
236
		mbShapeAction = sal_True;
225
	}
237
	}
226
	else if( nPrfx == XML_NAMESPACE_SCRIPT && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
238
	else if( nPrfx == XML_NAMESPACE_SCRIPT && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
227
	{
239
	{
Lines 288-294 SdXMLEventContext::SdXMLEventContext( Sv Link Here
288
				sEventName = sValue;
300
				sEventName = sValue;
289
				sal_uInt16 nScriptPrefix = 
301
				sal_uInt16 nScriptPrefix = 
290
					GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
302
					GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
291
				mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == msXMLEventName;
303
				mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == msXMLEventName | sEventName == msXMLShapeAction );
292
			}
304
			}
293
			else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
305
			else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
294
			{
306
			{
Lines 314-330 SdXMLEventContext::SdXMLEventContext( Sv Link Here
314
			if( IsXMLToken( aAttrLocalName, XML_HREF ) )
326
			if( IsXMLToken( aAttrLocalName, XML_HREF ) )
315
			{
327
			{
316
				if ( mbScript )
328
				if ( mbScript )
317
				{
318
					msMacroName = sValue;
329
					msMacroName = sValue;
319
				}
320
				else
330
				else
321
				{
331
				{
322
					const rtl::OUString &rTmp = 
332
					if ( !mbShapeAction )
323
						rImp.GetAbsoluteReference(sValue);
333
					{
324
					INetURLObject::translateToInternal( rTmp, msBookmark, 
334
						const rtl::OUString &rTmp = 
325
						INetURLObject::WAS_ENCODED, 
335
							rImp.GetAbsoluteReference(sValue);
326
						INetURLObject::DECODE_UNAMBIGUOUS, 
336
						INetURLObject::translateToInternal( rTmp, msBookmark, 
327
						RTL_TEXTENCODING_UTF8 );
337
							INetURLObject::WAS_ENCODED, 
338
							INetURLObject::DECODE_UNAMBIGUOUS, 
339
							RTL_TEXTENCODING_UTF8 );
340
					}
341
					else
342
						msHyperURL = sValue;	
328
				}
343
				}
329
			}
344
			}
330
			break;
345
			break;
Lines 344-374 SvXMLImportContext * SdXMLEventContext:: Link Here
344
	return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this );
359
	return new XMLEventSoundContext( GetImport(), nPrefix, rLocalName, xAttrList, this );
345
}
360
}
346
361
347
void SdXMLEventContext::EndElement()
362
void  SdXMLEventContext::fillMacroEventProps( beans::PropertyValue*& pProperties)
348
{
363
{
349
	const OUString msAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
364
	pProperties->Name =
365
			OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
366
	pProperties->Handle = -1;
367
	pProperties->Value <<= OUString(
368
		RTL_CONSTASCII_USTRINGPARAM("Script") );
369
	pProperties->State = beans::PropertyState_DIRECT_VALUE;
370
	pProperties++;
371
372
	pProperties->Name = OUString(
373
		RTL_CONSTASCII_USTRINGPARAM( "Script" ) );
374
	pProperties->Handle = -1;
375
	pProperties->Value <<= msMacroName;
376
	pProperties->State = beans::PropertyState_DIRECT_VALUE;
377
}
350
378
351
	if( !mbValid )
379
void  SdXMLEventContext::processShapeEvents( const Reference< XNameReplace >& xEvents )
380
{
381
	OUString sAPIEventName;
382
	if ( mbShapeAction )
383
		sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ));
384
	else if ( mbScript )
385
		sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ));
386
	else
387
		return;
388
	if( !xEvents->hasByName( sAPIEventName ) )
352
		return;
389
		return;
353
390
354
	do
391
	uno::Sequence< beans::PropertyValue > aProperties( 2 );
392
	beans::PropertyValue* pProperties = aProperties.getArray();
393
394
	if ( mbShapeAction )
355
	{
395
	{
356
		Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
396
		pProperties->Name =
357
		if( !xEventsSupplier.is() )
397
			OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
358
			break;
398
		pProperties->Handle = -1;
399
		pProperties->Value <<= OUString(
400
			RTL_CONSTASCII_USTRINGPARAM("Action") );
401
		pProperties->State = beans::PropertyState_DIRECT_VALUE;
402
		pProperties++;
403
404
		pProperties->Name = OUString(
405
			RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
406
		pProperties->Handle = -1;
407
		pProperties->Value <<= msHyperURL;
408
		pProperties->State = beans::PropertyState_DIRECT_VALUE;
409
	}
410
	else
411
		fillMacroEventProps( pProperties );
412
	uno::Any aAny;
413
	aAny <<= aProperties;
414
	xEvents->replaceByName( sAPIEventName, aAny );
415
}
416
void  SdXMLEventContext::processPresentationEvents( const Reference< XNameReplace >& xEvents )
417
{
418
	const OUString sAPIEventName( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
419
	if( !xEvents->hasByName( sAPIEventName ) )
420
		return;
359
421
360
		Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
422
	sal_Int32 nPropertyCount = 2;
361
		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
423
	switch( meClickAction )
362
		if( !xEvents.is() )
424
	{
363
			break;
425
	case ClickAction_NONE:
426
	case ClickAction_PREVPAGE:
427
	case ClickAction_NEXTPAGE:
428
	case ClickAction_FIRSTPAGE:
429
	case ClickAction_LASTPAGE:
430
	case ClickAction_INVISIBLE:
431
	case ClickAction_STOPPRESENTATION:
432
		break;
433
	case ClickAction_PROGRAM:
434
	case ClickAction_VERB:
435
	case ClickAction_BOOKMARK:
436
	case ClickAction_DOCUMENT:
437
		nPropertyCount += 1;
438
		break;
439
	case ClickAction_MACRO:
440
		if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
441
			nPropertyCount += 1;
442
		break;
364
443
365
		if( !xEvents->hasByName( msAPIEventName ) )
444
	case ClickAction_SOUND:
366
			break;
445
		nPropertyCount += 2;
446
		break;
447
448
	case ClickAction_VANISH:
449
		nPropertyCount += 4;
450
		break;
451
	}
367
452
368
		if( mbScript )
453
	uno::Sequence< beans::PropertyValue > aProperties( nPropertyCount );
369
			meClickAction = ClickAction_MACRO;
454
	beans::PropertyValue* pProperties = aProperties.getArray();
455
456
	if( ClickAction_MACRO == meClickAction )
457
	{
458
		if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
459
		{
460
			OUString sLibrary;
461
			const OUString& rApp = GetXMLToken( XML_APPLICATION ); 
462
			const OUString& rDoc = GetXMLToken( XML_DOCUMENT ); 
463
			if( msMacroName.getLength() > rApp.getLength()+1 &&
464
				msMacroName.copy(0,rApp.getLength()).equalsIgnoreAsciiCase( rApp ) &&
465
				':' == msMacroName[rApp.getLength()] )
466
			{
467
				sLibrary = OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice"));
468
				msMacroName = msMacroName.copy( rApp.getLength()+1 );
469
			}
470
			else if( msMacroName.getLength() > rDoc.getLength()+1 &&
471
				msMacroName.copy(0,rDoc.getLength()).equalsIgnoreAsciiCase( rDoc ) &&
472
				':' == msMacroName[rDoc.getLength()] )
473
			{
474
				sLibrary = rDoc;
475
				msMacroName = msMacroName.copy( rDoc.getLength()+1 );
476
			}
477
478
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
479
			pProperties->Handle = -1;
480
			pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("StarBasic") );
481
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
482
			pProperties++;
483
484
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ) );
485
			pProperties->Handle = -1;
486
			pProperties->Value <<= msMacroName;
487
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
488
			pProperties++;
489
490
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Library" ) );
491
			pProperties->Handle = -1;
492
			pProperties->Value <<= sLibrary;
493
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
494
		}
495
		else
496
			fillMacroEventProps( pProperties );
497
	}
498
	else
499
	{
500
		pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
501
		pProperties->Handle = -1;
502
		pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
503
		pProperties->State = beans::PropertyState_DIRECT_VALUE;
504
		pProperties++;
505
506
		// ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event
507
		// so check here if its realy a bookmark or maybe a document
508
		if( meClickAction == ClickAction_BOOKMARK )
509
		{
510
			if( msBookmark.compareToAscii( "#", 1 ) != 0 )
511
				meClickAction = ClickAction_DOCUMENT;
512
		}
513
514
		pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ClickAction") );
515
		pProperties->Handle = -1;
516
		pProperties->Value <<= meClickAction;
517
		pProperties->State = beans::PropertyState_DIRECT_VALUE;
518
		pProperties++;
370
519
371
		sal_Int32 nPropertyCount = 2;
372
		switch( meClickAction )
520
		switch( meClickAction )
373
		{
521
		{
374
		case ClickAction_NONE:
522
		case ClickAction_NONE:
Lines 379-550 void SdXMLEventContext::EndElement() Link Here
379
		case ClickAction_INVISIBLE:
527
		case ClickAction_INVISIBLE:
380
		case ClickAction_STOPPRESENTATION:
528
		case ClickAction_STOPPRESENTATION:
381
			break;
529
			break;
382
		case ClickAction_PROGRAM:
530
383
		case ClickAction_VERB:
384
		case ClickAction_BOOKMARK:
531
		case ClickAction_BOOKMARK:
385
		case ClickAction_DOCUMENT:
532
			msBookmark = msBookmark.copy(1);
386
			nPropertyCount += 1;
387
			break;
388
		case ClickAction_MACRO:
389
			if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
390
				nPropertyCount += 1;
391
			break;
392
533
393
		case ClickAction_SOUND:
534
			// Note: no break here!!!
394
			nPropertyCount += 2;
535
536
		case ClickAction_DOCUMENT:
537
		case ClickAction_PROGRAM:
538
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Bookmark") );
539
			pProperties->Handle = -1;
540
			pProperties->Value <<= msBookmark;
541
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
395
			break;
542
			break;
396
543
397
		case ClickAction_VANISH:
544
		case ClickAction_VANISH:
398
			nPropertyCount += 4;
545
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Effect") );
399
			break;
546
			pProperties->Handle = -1;
400
		}
547
			pProperties->Value <<= ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, sal_True );
548
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
549
			pProperties++;
401
550
402
		uno::Sequence< beans::PropertyValue > aProperties( nPropertyCount );
551
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Speed") );
403
		beans::PropertyValue* pProperties = aProperties.getArray();
552
			pProperties->Handle = -1;
553
			pProperties->Value <<= meSpeed;
554
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
555
			pProperties++;
404
556
405
		if( ClickAction_MACRO == meClickAction )
557
			// NOTE: no break here!!!
406
		{
407
			if ( msLanguage.equalsIgnoreAsciiCaseAscii("starbasic") )
408
			{
409
				OUString sLibrary;
410
				const OUString& rApp = GetXMLToken( XML_APPLICATION ); 
411
				const OUString& rDoc = GetXMLToken( XML_DOCUMENT ); 
412
				if( msMacroName.getLength() > rApp.getLength()+1 &&
413
					msMacroName.copy(0,rApp.getLength()).equalsIgnoreAsciiCase( rApp ) &&
414
					':' == msMacroName[rApp.getLength()] )
415
				{
416
					sLibrary = OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice"));
417
					msMacroName = msMacroName.copy( rApp.getLength()+1 );
418
				}
419
				else if( msMacroName.getLength() > rDoc.getLength()+1 &&
420
					msMacroName.copy(0,rDoc.getLength()).equalsIgnoreAsciiCase( rDoc ) &&
421
					':' == msMacroName[rDoc.getLength()] )
422
				{
423
					sLibrary = rDoc;
424
					msMacroName = msMacroName.copy( rDoc.getLength()+1 );
425
				}
426
558
427
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
559
		case ClickAction_SOUND:
428
				pProperties->Handle = -1;
560
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("SoundURL") );
429
				pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("StarBasic") );
430
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
431
				pProperties++;
432
433
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "MacroName" ) );
434
				pProperties->Handle = -1;
435
				pProperties->Value <<= msMacroName;
436
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
437
				pProperties++;
438
439
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Library" ) );
440
				pProperties->Handle = -1;
441
				pProperties->Value <<= sLibrary;
442
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
443
			}
444
			else
445
			{
446
				pProperties->Name =
447
					OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
448
				pProperties->Handle = -1;
449
				pProperties->Value <<= OUString(
450
					RTL_CONSTASCII_USTRINGPARAM("Script") );
451
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
452
				pProperties++;
453
454
				pProperties->Name = OUString(
455
					RTL_CONSTASCII_USTRINGPARAM( "Script" ) );
456
				pProperties->Handle = -1;
457
				pProperties->Value <<= msMacroName;
458
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
459
			}
460
		}
461
		else
462
		{
463
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
464
			pProperties->Handle = -1;
561
			pProperties->Handle = -1;
465
			pProperties->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM("Presentation") );
562
			pProperties->Value <<= msSoundURL;
466
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
563
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
467
			pProperties++;
564
			pProperties++;
468
565
469
			// ClickAction_BOOKMARK and ClickAction_DOCUMENT share the same xml event
566
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PlayFull") );
470
			// so check here if its realy a bookmark or maybe a document
567
			pProperties->Handle = -1;
471
			if( meClickAction == ClickAction_BOOKMARK )
568
			pProperties->Value = ::cppu::bool2any(mbPlayFull);
472
			{
569
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
473
				if( msBookmark.compareToAscii( "#", 1 ) != 0 )
570
			break;
474
					meClickAction = ClickAction_DOCUMENT;
475
			}
476
571
477
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("ClickAction") );
572
		case ClickAction_VERB:
573
			pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Verb") );
478
			pProperties->Handle = -1;
574
			pProperties->Handle = -1;
479
			pProperties->Value <<= meClickAction;
575
			pProperties->Value <<= mnVerb;
480
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
576
			pProperties->State = beans::PropertyState_DIRECT_VALUE;
481
			pProperties++;
577
			break;
578
		}
579
	}
580
	uno::Any aAny;
581
	aAny <<= aProperties;
582
	xEvents->replaceByName( sAPIEventName, aAny );
482
583
483
			switch( meClickAction )
584
}
484
			{
585
void SdXMLEventContext::EndElement()
485
			case ClickAction_NONE:
586
{
486
			case ClickAction_PREVPAGE:
587
487
			case ClickAction_NEXTPAGE:
588
	if( !mbValid )
488
			case ClickAction_FIRSTPAGE:
589
		return;
489
			case ClickAction_LASTPAGE:
490
			case ClickAction_INVISIBLE:
491
			case ClickAction_STOPPRESENTATION:
492
				break;
493
590
494
			case ClickAction_BOOKMARK:
591
	do
495
				msBookmark = msBookmark.copy(1);
592
	{
593
		Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY );
594
		if( !xEventsSupplier.is() )
595
			break;
496
596
497
				// Note: no break here!!!
597
		Reference< XNameReplace > xEvents( xEventsSupplier->getEvents() );
598
		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
599
		if( !xEvents.is() )
600
			break;
498
601
499
			case ClickAction_DOCUMENT:
602
		switch( mnPrfx )
500
			case ClickAction_PROGRAM:
603
		{
501
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Bookmark") );
604
			case XML_NAMESPACE_PRESENTATION:
502
				pProperties->Handle = -1;
605
				processPresentationEvents( xEvents );	
503
				pProperties->Value <<= msBookmark;
504
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
505
				break;
606
				break;
506
607
			case XML_NAMESPACE_DRAW:
507
			case ClickAction_VANISH:
608
			case XML_NAMESPACE_SCRIPT:
508
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Effect") );
609
				processShapeEvents( xEvents );
509
				pProperties->Handle = -1;
510
				pProperties->Value <<= ImplSdXMLgetEffect( meEffect, meDirection, mnStartScale, sal_True );
511
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
512
				pProperties++;
513
514
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Speed") );
515
				pProperties->Handle = -1;
516
				pProperties->Value <<= meSpeed;
517
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
518
				pProperties++;
519
520
				// NOTE: no break here!!!
521
522
			case ClickAction_SOUND:
523
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("SoundURL") );
524
				pProperties->Handle = -1;
525
				pProperties->Value <<= msSoundURL;
526
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
527
				pProperties++;
528
529
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("PlayFull") );
530
				pProperties->Handle = -1;
531
				pProperties->Value = ::cppu::bool2any(mbPlayFull);
532
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
533
				break;
610
				break;
534
611
			default:
535
			case ClickAction_VERB:
536
				pProperties->Name = OUString( RTL_CONSTASCII_USTRINGPARAM("Verb") );
537
				pProperties->Handle = -1;
538
				pProperties->Value <<= mnVerb;
539
				pProperties->State = beans::PropertyState_DIRECT_VALUE;
540
				break;
612
				break;
541
			}
542
		}
613
		}
543
614
544
		uno::Any aAny;
545
		aAny <<= aProperties;
546
		xEvents->replaceByName( msAPIEventName, aAny );
547
548
	} while(0);
615
	} while(0);
549
}
616
}
550
617
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/shapeexport2.cxx (-212 / +242 lines)
Lines 352-625 void XMLShapeExport::ImpExportText( cons Link Here
352
#define FOUND_EVENTTYPE		0x0080
352
#define FOUND_EVENTTYPE		0x0080
353
#define FOUND_MACRO			0x0100
353
#define FOUND_MACRO			0x0100
354
#define FOUND_LIBRARY		0x0200
354
#define FOUND_LIBRARY		0x0200
355
#define FOUND_ACTION		0x0400
355
356
356
void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& xShape )
357
void XMLShapeExport::ImpExportEvents( const beans::PropertyValue* pProperties, const sal_Int32 nCount )
357
{
358
{
358
	do
359
	sal_Int32 nFound = 0;
360
	OUString aStrEventType;
361
	presentation::ClickAction eClickAction;
362
	presentation::AnimationEffect eEffect;
363
	presentation::AnimationSpeed eSpeed;
364
	OUString aStrSoundURL;
365
	sal_Bool bPlayFull;
366
	sal_Int32 nVerb;
367
	OUString aStrMacro;
368
	OUString aStrLibrary;
369
	OUString aStrBookmark;
370
	OUString aHyperURL;
371
	sal_Int32 nIndex;
372
	for( nIndex = 0; nIndex < nCount; nIndex++, pProperties++ )
359
	{
373
	{
360
		uno::Reference< document::XEventsSupplier > xEventsSupplier( xShape, uno::UNO_QUERY );
374
		if( ( ( nFound & FOUND_EVENTTYPE ) == 0 ) && pProperties->Name == msEventType )
361
		if( !xEventsSupplier.is() )
375
		{
362
			break;
376
			if( pProperties->Value >>= aStrEventType )
377
				nFound |= FOUND_EVENTTYPE;
378
		}
379
		else if( ( ( nFound & FOUND_CLICKACTION ) == 0 ) && pProperties->Name == msClickAction )
380
		{
381
			if( pProperties->Value >>= eClickAction )
382
				nFound |= FOUND_CLICKACTION;
383
		}
384
		else if( ( ( nFound & FOUND_MACRO ) == 0 ) && ( pProperties->Name == msMacroName || pProperties->Name == msScript ) )
385
		{
386
			if( pProperties->Value >>= aStrMacro )
387
				nFound |= FOUND_MACRO;
388
		}
389
		else if( ( ( nFound & FOUND_ACTION ) == 0 ) && ( pProperties->Name == msURL  ) )
390
		{
391
			if( pProperties->Value >>= aHyperURL )
392
				nFound |= FOUND_ACTION;
393
		}
394
		else if( ( ( nFound & FOUND_LIBRARY ) == 0 ) && pProperties->Name == msLibrary )
395
		{
396
			if( pProperties->Value >>= aStrLibrary )
397
				nFound |= FOUND_LIBRARY;
398
		}
399
		else if( ( ( nFound & FOUND_EFFECT ) == 0 ) && pProperties->Name == msEffect )
400
		{
401
			if( pProperties->Value >>= eEffect )
402
				nFound |= FOUND_EFFECT;
403
		}
404
		else if( ( ( nFound & FOUND_BOOKMARK ) == 0 ) && pProperties->Name == msBookmark )
405
		{
406
			if( pProperties->Value >>= aStrBookmark )
407
				nFound |= FOUND_BOOKMARK;
408
		}
409
		else if( ( ( nFound & FOUND_SPEED ) == 0 ) && pProperties->Name == msSpeed )
410
		{
411
			if( pProperties->Value >>= eSpeed )
412
				nFound |= FOUND_SPEED;
413
		}
414
		else if( ( ( nFound & FOUND_SOUNDURL ) == 0 ) && pProperties->Name == msSoundURL )
415
		{
416
			if( pProperties->Value >>= aStrSoundURL )
417
				nFound |= FOUND_SOUNDURL;
418
		}
419
		else if( ( ( nFound & FOUND_PLAYFULL ) == 0 ) && pProperties->Name == msPlayFull )
420
		{
421
			if( pProperties->Value >>= bPlayFull )
422
				nFound |= FOUND_PLAYFULL;
423
		}
424
		else if( ( ( nFound & FOUND_VERB ) == 0 ) && pProperties->Name == msVerb )
425
		{
426
			if( pProperties->Value >>= nVerb )
427
				nFound |= FOUND_VERB;
428
		}
429
	}
363
430
364
		uno::Reference< container::XNameReplace > xEvents( xEventsSupplier->getEvents() );
431
	if( ( nFound & FOUND_EVENTTYPE ) == 0 )
365
		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
432
		return;
366
		if( !xEvents.is() )
367
			break;
368
433
369
		uno::Sequence< beans::PropertyValue > aProperties;
434
	if( aStrEventType == msPresentation )
370
		if( !xEvents->hasByName( msOnClick ) )
435
	{
371
			break;
436
		if( ( nFound & FOUND_CLICKACTION ) == 0 )
437
			return;
372
438
373
		if( !(xEvents->getByName( msOnClick ) >>= aProperties) )
439
		if( eClickAction == presentation::ClickAction_NONE )
374
			break;
440
			return;
375
441
376
		sal_Int32 nFound = 0;
442
		SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
377
		const beans::PropertyValue* pProperties = aProperties.getConstArray();
378
443
379
		OUString aStrEventType;
444
		enum XMLTokenEnum eStrAction;
380
		presentation::ClickAction eClickAction;
381
		presentation::AnimationEffect eEffect;
382
		presentation::AnimationSpeed eSpeed;
383
		OUString aStrSoundURL;
384
		sal_Bool bPlayFull;
385
		sal_Int32 nVerb;
386
		OUString aStrMacro;
387
		OUString aStrLibrary;
388
		OUString aStrBookmark;
389
445
390
		const sal_Int32 nCount = aProperties.getLength();
446
		switch( eClickAction )
391
		sal_Int32 nIndex;
392
		for( nIndex = 0; nIndex < nCount; nIndex++, pProperties++ )
393
		{
447
		{
394
			if( ( ( nFound & FOUND_EVENTTYPE ) == 0 ) && pProperties->Name == msEventType )
448
		case presentation::ClickAction_PREVPAGE:		eStrAction = XML_PREVIOUS_PAGE; break;
395
			{
449
		case presentation::ClickAction_NEXTPAGE:		eStrAction = XML_NEXT_PAGE; break;
396
				if( pProperties->Value >>= aStrEventType )
450
		case presentation::ClickAction_FIRSTPAGE:		eStrAction = XML_FIRST_PAGE; break;
397
					nFound |= FOUND_EVENTTYPE;
451
		case presentation::ClickAction_LASTPAGE:		eStrAction = XML_LAST_PAGE; break;
398
			}
452
		case presentation::ClickAction_INVISIBLE:		eStrAction = XML_HIDE; break;
399
			else if( ( ( nFound & FOUND_CLICKACTION ) == 0 ) && pProperties->Name == msClickAction )
453
		case presentation::ClickAction_STOPPRESENTATION:eStrAction = XML_STOP; break;
400
			{
454
		case presentation::ClickAction_PROGRAM:			eStrAction = XML_EXECUTE; break;
401
				if( pProperties->Value >>= eClickAction )
455
		case presentation::ClickAction_BOOKMARK:		eStrAction = XML_SHOW; break;
402
					nFound |= FOUND_CLICKACTION;
456
		case presentation::ClickAction_DOCUMENT:		eStrAction = XML_SHOW; break;
403
			}
457
		case presentation::ClickAction_MACRO:			eStrAction = XML_EXECUTE_MACRO; break;
404
			else if( ( ( nFound & FOUND_MACRO ) == 0 ) && ( pProperties->Name == msMacroName || pProperties->Name == msScript ) )
458
		case presentation::ClickAction_VERB:			eStrAction = XML_VERB; break;
405
			{
459
		case presentation::ClickAction_VANISH:			eStrAction = XML_FADE_OUT; break;
406
				if( pProperties->Value >>= aStrMacro )
460
		case presentation::ClickAction_SOUND:			eStrAction = XML_SOUND; break;
407
					nFound |= FOUND_MACRO;
461
		default:
408
			}
462
			DBG_ERROR( "unknown presentation::ClickAction found!" );
409
			else if( ( ( nFound & FOUND_LIBRARY ) == 0 ) && pProperties->Name == msLibrary )
463
			eStrAction = XML_UNKNOWN;
410
			{
411
				if( pProperties->Value >>= aStrLibrary )
412
					nFound |= FOUND_LIBRARY;
413
			}
414
			else if( ( ( nFound & FOUND_EFFECT ) == 0 ) && pProperties->Name == msEffect )
415
			{
416
				if( pProperties->Value >>= eEffect )
417
					nFound |= FOUND_EFFECT;
418
			}
419
			else if( ( ( nFound & FOUND_BOOKMARK ) == 0 ) && pProperties->Name == msBookmark )
420
			{
421
				if( pProperties->Value >>= aStrBookmark )
422
					nFound |= FOUND_BOOKMARK;
423
			}
424
			else if( ( ( nFound & FOUND_SPEED ) == 0 ) && pProperties->Name == msSpeed )
425
			{
426
				if( pProperties->Value >>= eSpeed )
427
					nFound |= FOUND_SPEED;
428
			}
429
			else if( ( ( nFound & FOUND_SOUNDURL ) == 0 ) && pProperties->Name == msSoundURL )
430
			{
431
				if( pProperties->Value >>= aStrSoundURL )
432
					nFound |= FOUND_SOUNDURL;
433
			}
434
			else if( ( ( nFound & FOUND_PLAYFULL ) == 0 ) && pProperties->Name == msPlayFull )
435
			{
436
				if( pProperties->Value >>= bPlayFull )
437
					nFound |= FOUND_PLAYFULL;
438
			}
439
			else if( ( ( nFound & FOUND_VERB ) == 0 ) && pProperties->Name == msVerb )
440
			{
441
				if( pProperties->Value >>= nVerb )
442
					nFound |= FOUND_VERB;
443
			}
444
		}
464
		}
445
465
446
		if( ( nFound & FOUND_EVENTTYPE ) == 0 )
466
		OUString aEventQName(
447
			break;
467
			rExport.GetNamespaceMap().GetQNameByKey(
468
					XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
469
		rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
470
		rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_ACTION, eStrAction );
448
471
449
		if( aStrEventType == msPresentation )
472
		if( eClickAction == presentation::ClickAction_VANISH )
450
		{
473
		{
451
			if( ( nFound & FOUND_CLICKACTION ) == 0 )
474
			if( nFound & FOUND_EFFECT )
452
				break;
475
			{
476
				XMLEffect eKind;
477
				XMLEffectDirection eDirection;
478
				sal_Int16 nStartScale;
479
				sal_Bool bIn;
453
480
454
			if( eClickAction == presentation::ClickAction_NONE )
481
				SdXMLImplSetEffect( eEffect, eKind, eDirection, nStartScale, bIn );
455
				break;
456
482
457
			SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
483
				if( eEffect != EK_none )
484
				{
485
					SvXMLUnitConverter::convertEnum( msBuffer, eKind, aXML_AnimationEffect_EnumMap );
486
					rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_EFFECT, msBuffer.makeStringAndClear() );
487
				}
458
488
459
			enum XMLTokenEnum eStrAction;
489
				if( eDirection != ED_none )
490
				{
491
					SvXMLUnitConverter::convertEnum( msBuffer, eDirection, aXML_AnimationDirection_EnumMap );
492
					rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_DIRECTION, msBuffer.makeStringAndClear() );
493
				}
460
494
461
			switch( eClickAction )
495
				if( nStartScale != -1 )
462
			{
496
				{
463
			case presentation::ClickAction_PREVPAGE:		eStrAction = XML_PREVIOUS_PAGE; break;
497
					SvXMLUnitConverter::convertPercent( msBuffer, nStartScale );
464
			case presentation::ClickAction_NEXTPAGE:		eStrAction = XML_NEXT_PAGE; break;
498
					rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, msBuffer.makeStringAndClear() );
465
			case presentation::ClickAction_FIRSTPAGE:		eStrAction = XML_FIRST_PAGE; break;
499
				}
466
			case presentation::ClickAction_LASTPAGE:		eStrAction = XML_LAST_PAGE; break;
467
			case presentation::ClickAction_INVISIBLE:		eStrAction = XML_HIDE; break;
468
			case presentation::ClickAction_STOPPRESENTATION:eStrAction = XML_STOP; break;
469
			case presentation::ClickAction_PROGRAM:			eStrAction = XML_EXECUTE; break;
470
			case presentation::ClickAction_BOOKMARK:		eStrAction = XML_SHOW; break;
471
			case presentation::ClickAction_DOCUMENT:		eStrAction = XML_SHOW; break;
472
			case presentation::ClickAction_MACRO:			eStrAction = XML_EXECUTE_MACRO; break;
473
			case presentation::ClickAction_VERB:			eStrAction = XML_VERB; break;
474
			case presentation::ClickAction_VANISH:			eStrAction = XML_FADE_OUT; break;
475
			case presentation::ClickAction_SOUND:			eStrAction = XML_SOUND; break;
476
			default:
477
				DBG_ERROR( "unknown presentation::ClickAction found!" );
478
				eStrAction = XML_UNKNOWN;
479
			}
500
			}
480
501
481
			OUString aEventQName(
502
			if( nFound & FOUND_SPEED && eEffect != presentation::AnimationEffect_NONE )
482
				rExport.GetNamespaceMap().GetQNameByKey(
483
						XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
484
			rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
485
			rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_ACTION, eStrAction );
486
487
			if( eClickAction == presentation::ClickAction_VANISH )
488
			{
503
			{
489
				if( nFound & FOUND_EFFECT )
504
				if( eSpeed != presentation::AnimationSpeed_MEDIUM )
490
				{
505
				{
491
					XMLEffect eKind;
506
					SvXMLUnitConverter::convertEnum( msBuffer, eSpeed, aXML_AnimationSpeed_EnumMap );
492
					XMLEffectDirection eDirection;
507
					rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, msBuffer.makeStringAndClear() );
493
					sal_Int16 nStartScale;
508
				}
494
					sal_Bool bIn;
509
			}
495
510
		}
496
					SdXMLImplSetEffect( eEffect, eKind, eDirection, nStartScale, bIn );
497
511
498
					if( eEffect != EK_none )
512
		if( eClickAction == presentation::ClickAction_PROGRAM ||
499
					{
513
			eClickAction == presentation::ClickAction_BOOKMARK ||
500
						SvXMLUnitConverter::convertEnum( msBuffer, eKind, aXML_AnimationEffect_EnumMap );
514
			eClickAction == presentation::ClickAction_DOCUMENT )
501
						rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_EFFECT, msBuffer.makeStringAndClear() );
515
		{
502
					}
516
			if( eClickAction == presentation::ClickAction_BOOKMARK )
517
				msBuffer.append( sal_Unicode('#') );
503
518
504
					if( eDirection != ED_none )
519
			msBuffer.append( aStrBookmark );
505
					{
520
			rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(msBuffer.makeStringAndClear()) );
506
						SvXMLUnitConverter::convertEnum( msBuffer, eDirection, aXML_AnimationDirection_EnumMap );
521
			rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
507
						rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_DIRECTION, msBuffer.makeStringAndClear() );
522
			rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
508
					}
523
			rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
524
		}
509
525
510
					if( nStartScale != -1 )
526
		if( ( nFound & FOUND_VERB ) && eClickAction == presentation::ClickAction_VERB )
511
					{
527
		{
512
						SvXMLUnitConverter::convertPercent( msBuffer, nStartScale );
528
			msBuffer.append( nVerb );
513
						rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_START_SCALE, msBuffer.makeStringAndClear() );
529
			rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_VERB, msBuffer.makeStringAndClear());
514
					}
530
		}
515
				}
516
531
517
				if( nFound & FOUND_SPEED && eEffect != presentation::AnimationEffect_NONE )
532
		SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
518
				{
519
					if( eSpeed != presentation::AnimationSpeed_MEDIUM )
520
					{
521
						SvXMLUnitConverter::convertEnum( msBuffer, eSpeed, aXML_AnimationSpeed_EnumMap );
522
						rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SPEED, msBuffer.makeStringAndClear() );
523
					}
524
				}
525
			}
526
533
527
			if( eClickAction == presentation::ClickAction_PROGRAM ||
534
		if( eClickAction == presentation::ClickAction_VANISH || eClickAction == presentation::ClickAction_SOUND )
528
				eClickAction == presentation::ClickAction_BOOKMARK ||
535
		{
529
				eClickAction == presentation::ClickAction_DOCUMENT )
536
			if( ( nFound & FOUND_SOUNDURL ) && aStrSoundURL.getLength() != 0 )
530
			{
537
			{
531
				if( eClickAction == presentation::ClickAction_BOOKMARK )
538
				rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStrSoundURL) );
532
					msBuffer.append( sal_Unicode('#') );
533
534
				msBuffer.append( aStrBookmark );
535
				rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(msBuffer.makeStringAndClear()) );
536
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
539
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
537
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
540
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
538
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
541
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
539
			}
542
				if( nFound & FOUND_PLAYFULL && bPlayFull )
543
					rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PLAY_FULL, XML_TRUE );
540
544
541
			if( ( nFound & FOUND_VERB ) && eClickAction == presentation::ClickAction_VERB )
545
				SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
542
			{
543
				msBuffer.append( nVerb );
544
				rExport.AddAttribute(XML_NAMESPACE_PRESENTATION, XML_VERB, msBuffer.makeStringAndClear());
545
			}
546
			}
547
		}
548
	}
549
	else if( aStrEventType == msStarBasic )
550
	{
551
		if( nFound & FOUND_MACRO )
552
		{
553
			SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
546
554
547
			SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
555
			rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, 
556
						rExport.GetNamespaceMap().GetQNameByKey(
557
						 	XML_NAMESPACE_OOO, 
558
						 	OUString( RTL_CONSTASCII_USTRINGPARAM( 
559
											"starbasic" ) ) ) );
560
			OUString aEventQName(
561
				rExport.GetNamespaceMap().GetQNameByKey(
562
						XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
563
			rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
548
564
549
			if( eClickAction == presentation::ClickAction_VANISH || eClickAction == presentation::ClickAction_SOUND )
565
			if( nFound & FOUND_LIBRARY )
550
			{
566
			{
551
				if( ( nFound & FOUND_SOUNDURL ) && aStrSoundURL.getLength() != 0 )
567
				const OUString& rApp = GetXMLToken( XML_APPLICATION );
552
				{
568
				const OUString& rDoc = GetXMLToken( XML_DOCUMENT );
553
					rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, GetExport().GetRelativeReference(aStrSoundURL) );
569
				OUString sLocation( GetXMLToken(
554
					rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
570
					(aStrLibrary.equalsIgnoreAsciiCaseAscii("StarOffice") ||
555
					rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_SHOW, XML_NEW );
571
				 	 aStrLibrary.equalsIgnoreAsciiCaseAscii("application") ) ? XML_APPLICATION
556
					rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
572
														   			   : XML_DOCUMENT ) );
557
					if( nFound & FOUND_PLAYFULL && bPlayFull )
573
				OUStringBuffer sTmp( sLocation.getLength() + aStrMacro.getLength() + 1 );
558
						rExport.AddAttribute( XML_NAMESPACE_PRESENTATION, XML_PLAY_FULL, XML_TRUE );
574
				sTmp = sLocation;
559
575
				sTmp.append( sal_Unicode( ':' ) );
560
					SvXMLElementExport aElem( rExport, XML_NAMESPACE_PRESENTATION, XML_SOUND, sal_True, sal_True );
576
				sTmp.append( aStrMacro );
561
				}
577
				rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME,
578
									 sTmp.makeStringAndClear());
562
			}
579
			}
563
			break;
580
			else
581
			{
582
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, aStrMacro );
583
			}
584
585
586
			SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
564
		}
587
		}
565
		else if( aStrEventType == msStarBasic )
588
	}
589
	else if( aStrEventType == msScript || aStrEventType == msAction )
590
	{
591
		if( nFound & ( FOUND_MACRO | FOUND_ACTION ) )
566
		{
592
		{
567
			if( nFound & FOUND_MACRO )
593
			SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
594
			if ( nFound & FOUND_MACRO )
568
			{
595
			{
569
				SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
596
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, rExport.GetNamespaceMap().GetQNameByKey(
570
597
						 XML_NAMESPACE_OOO, GetXMLToken(XML_SCRIPT) ) );
571
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, 
572
							rExport.GetNamespaceMap().GetQNameByKey(
573
							 	XML_NAMESPACE_OOO, 
574
							 	OUString( RTL_CONSTASCII_USTRINGPARAM( 
575
												"starbasic" ) ) ) );
576
				OUString aEventQName(
598
				OUString aEventQName(
577
					rExport.GetNamespaceMap().GetQNameByKey(
599
					rExport.GetNamespaceMap().GetQNameByKey(
578
							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
600
							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
579
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
601
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
580
602
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStrMacro );
581
				if( nFound & FOUND_LIBRARY )
582
				{
583
					const OUString& rApp = GetXMLToken( XML_APPLICATION );
584
					const OUString& rDoc = GetXMLToken( XML_DOCUMENT );
585
					OUString sLocation( GetXMLToken(
586
						(aStrLibrary.equalsIgnoreAsciiCaseAscii("StarOffice") ||
587
					 	 aStrLibrary.equalsIgnoreAsciiCaseAscii("application") ) ? XML_APPLICATION
588
															   			   : XML_DOCUMENT ) );
589
					OUStringBuffer sTmp( sLocation.getLength() + aStrMacro.getLength() + 1 );
590
					sTmp = sLocation;
591
					sTmp.append( sal_Unicode( ':' ) );
592
					sTmp.append( aStrMacro );
593
					rExport.AddAttribute(XML_NAMESPACE_SCRIPT, XML_MACRO_NAME,
594
										 sTmp.makeStringAndClear());
595
				}
596
				else
597
				{
598
					rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_MACRO_NAME, aStrMacro );
599
				}
600
601
603
602
				SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
604
				SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
603
			}
605
			}
604
		}
606
			if ( nFound & FOUND_ACTION )
605
		else if( aStrEventType == msScript )
606
		{
607
			if( nFound & FOUND_MACRO )
608
			{
607
			{
609
				SvXMLElementExport aEventsElemt(rExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
610
611
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, rExport.GetNamespaceMap().GetQNameByKey(
608
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_LANGUAGE, rExport.GetNamespaceMap().GetQNameByKey(
612
							 XML_NAMESPACE_OOO, GetXMLToken(XML_SCRIPT) ) );
609
						 XML_NAMESPACE_OOO, GetXMLToken(XML_SCRIPT) ) );
613
				OUString aEventQName(
610
				OUString aEventQName(
614
					rExport.GetNamespaceMap().GetQNameByKey(
611
					rExport.GetNamespaceMap().GetQNameByKey(
615
							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "click" ) ) ) );
612
							XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) );
616
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
613
				rExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
617
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aStrMacro );
614
				rExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL );
618
615
619
				SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
616
				SvXMLElementExport aEventElemt(rExport, XML_NAMESPACE_DRAW, XML_EVENT_LISTENER, sal_True, sal_True);
620
			}
617
			}
621
		}
618
		}
622
	}
619
	}
620
}
621
622
void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& xShape )
623
{
624
	do
625
	{
626
		uno::Reference< document::XEventsSupplier > xEventsSupplier( xShape, uno::UNO_QUERY );
627
		if( !xEventsSupplier.is() )
628
			break;
629
630
		uno::Reference< container::XNameReplace > xEvents( xEventsSupplier->getEvents() );
631
		DBG_ASSERT( xEvents.is(), "XEventsSupplier::getEvents() returned NULL" );
632
		if( !xEvents.is() )
633
			break;
634
635
		static uno::Sequence< OUString > aEvents = xEvents->getElementNames();
636
		const OUString* pEvt = aEvents.getConstArray();
637
		const OUString* pEnd = aEvents.getConstArray() + aEvents.getLength();
638
639
		for ( ; pEvt != pEnd; ++pEvt )
640
		{
641
			uno::Sequence< beans::PropertyValue > aProperties;
642
			if( !xEvents->hasByName( *pEvt ) )
643
				break;
644
645
			if( !(xEvents->getByName( *pEvt ) >>= aProperties) )
646
				break;
647
			const beans::PropertyValue* pProperties = aProperties.getConstArray();
648
			const sal_Int32 nCount = aProperties.getLength();
649
			ImpExportEvents( pProperties, nCount );
650
		}
651
652
	}
623
	while(0);
653
	while(0);
624
}
654
}
625
655
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/xmloff/source/draw/shapeexport.cxx (+3 lines)
Lines 158-163 XMLShapeExport::XMLShapeExport(SvXMLExpo Link Here
158
	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
158
	msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
159
	msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
159
	msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
160
	msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
160
	msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
161
	msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ),
162
	msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ),
163
	msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ),
161
	msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
164
	msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
162
	msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
165
	msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
163
	msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
166
	msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/inc/sc.hrc (+3 lines)
Lines 574-579 Link Here
574
// additional IDs for list/range validity
574
// additional IDs for list/range validity
575
#define FID_VALID_LISTTYPE              (SC_VIEW_START + 93)
575
#define FID_VALID_LISTTYPE              (SC_VIEW_START + 93)
576
#define SID_ASSIGNMACRO			(SC_VIEW_START + 94)
576
#define SID_ASSIGNMACRO			(SC_VIEW_START + 94)
577
#define SID_EDITLNK_ATTR_DLG	(SC_VIEW_START + 95)
578
#define SID_DELLNK	(SC_VIEW_START + 96)
579
#define SID_OPENLNK	(SC_VIEW_START + 97)
577
580
578
// Nachrichten -------------------------------------------------------------
581
// Nachrichten -------------------------------------------------------------
579
582
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/inc/userdat.hxx (+3 lines)
Lines 108-113 public: Link Here
108
class ScMacroInfo : public SdrObjUserData
108
class ScMacroInfo : public SdrObjUserData
109
{
109
{
110
	rtl::OUString sMacro;
110
	rtl::OUString sMacro;
111
	rtl::OUString sHlink;
111
public:
112
public:
112
					ScMacroInfo();
113
					ScMacroInfo();
113
	virtual			~ScMacroInfo();
114
	virtual			~ScMacroInfo();
Lines 115-121 public: Link Here
115
	virtual	SdrObjUserData* Clone( SdrObject* pObj ) const;
116
	virtual	SdrObjUserData* Clone( SdrObject* pObj ) const;
116
117
117
	void 	SetMacro( const rtl::OUString& rMacro )	{ sMacro = rMacro; }
118
	void 	SetMacro( const rtl::OUString& rMacro )	{ sMacro = rMacro; }
119
	void 	SetHlink( const rtl::OUString& rHlink )	{ sHlink = rHlink; }
118
	const rtl::OUString&	GetMacro() const				{ return sMacro; }
120
	const rtl::OUString&	GetMacro() const				{ return sMacro; }
121
	const rtl::OUString&	GetHlink() const				{ return sHlink; }
119
};
122
};
120
123
121
#endif
124
#endif
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/sdi/drawsh.sdi (+3 lines)
Lines 228-233 interface TableDraw Link Here
228
	SID_FONTWORK_CHARACTER_SPACING			[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
228
	SID_FONTWORK_CHARACTER_SPACING			[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
229
	SID_FONTWORK_KERN_CHARACTER_PAIRS		[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
229
	SID_FONTWORK_KERN_CHARACTER_PAIRS		[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
230
    SID_FONTWORK_CHARACTER_SPACING_DIALOG	[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
230
    SID_FONTWORK_CHARACTER_SPACING_DIALOG	[ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
231
	SID_EDITLNK_ATTR_DLG	[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
232
	SID_DELLNK	[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
233
	SID_OPENLNK	[ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
231
}
234
}
232
235
233
236
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/sdi/scalc.sdi (+75 lines)
Lines 6822-6827 SfxVoidItem TableSelectAll FID_TAB_SELEC Link Here
6822
]
6822
]
6823
6823
6824
//--------------------------------------------------------------------------
6824
//--------------------------------------------------------------------------
6825
SfxVoidItem EditHyper SID_EDITLNK_ATTR_DLG
6826
()
6827
[
6828
	/* flags: */
6829
	AutoUpdate = FALSE,
6830
	Cachable = Cachable,
6831
	FastCall = TRUE,
6832
	HasCoreId = FALSE,
6833
	HasDialog = TRUE,
6834
	ReadOnlyDoc = TRUE,
6835
	Toggle = FALSE,
6836
	Container = FALSE,
6837
	RecordAbsolute = FALSE,
6838
	RecordPerSet;
6839
	Synchron;
6840
6841
	/* config: */
6842
	AccelConfig = TRUE,
6843
	MenuConfig = FALSE,
6844
	StatusBarConfig = FALSE,
6845
	ToolBoxConfig = FALSE,
6846
	GroupId = GID_DRAWING;
6847
]
6848
6849
//--------------------------------------------------------------------------
6850
SfxVoidItem DelHlink SID_DELLNK
6851
()
6852
[
6853
	/* flags: */
6854
	AutoUpdate = TRUE,
6855
	Cachable = Cachable,
6856
	FastCall = TRUE,
6857
	HasCoreId = FALSE,
6858
	HasDialog = FALSE,
6859
	ReadOnlyDoc = TRUE,
6860
	Toggle = FALSE,
6861
	Container = FALSE,
6862
	RecordAbsolute = FALSE,
6863
	RecordPerSet;
6864
	Synchron;
6865
	
6866
	/* config: */
6867
	AccelConfig = TRUE,
6868
	MenuConfig = FALSE,
6869
	StatusBarConfig = FALSE,
6870
	ToolBoxConfig = FALSE,
6871
	GroupId = GID_DRAWING;
6872
]
6873
6874
//--------------------------------------------------------------------------
6875
SfxVoidItem OpenHlink SID_OPENLNK
6876
()
6877
[
6878
	/* flags: */
6879
	AutoUpdate = TRUE,
6880
	Cachable = Cachable,
6881
	FastCall = TRUE,
6882
	HasCoreId = FALSE,
6883
	HasDialog = FALSE,
6884
	ReadOnlyDoc = TRUE,
6885
	Toggle = FALSE,
6886
	Container = FALSE,
6887
	RecordAbsolute = FALSE,
6888
	RecordPerSet;
6889
	Synchron;
6890
	
6891
	/* config: */
6892
	AccelConfig = TRUE,
6893
	MenuConfig = FALSE,
6894
	StatusBarConfig = FALSE,
6895
	ToolBoxConfig = FALSE,
6896
	GroupId = GID_DRAWING;
6897
]
6898
6899
//--------------------------------------------------------------------------
6825
SfxVoidItem TextAttributes SID_DRAWTEXT_ATTR_DLG
6900
SfxVoidItem TextAttributes SID_DRAWTEXT_ATTR_DLG
6826
()
6901
()
6827
[
6902
[
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/excel/xicontent.cxx (-4 / +13 lines)
Lines 281-296 void lclInsertUrl( const XclImpRoot& rRo Link Here
281
void XclImpHyperlink::ReadHlink( XclImpStream& rStrm )
281
void XclImpHyperlink::ReadHlink( XclImpStream& rStrm )
282
{
282
{
283
    const XclImpRoot& rRoot = rStrm.GetRoot();
283
    const XclImpRoot& rRoot = rStrm.GetRoot();
284
    XclRange aXclRange( ScAddress::UNINITIALIZED );
285
    rStrm >> aXclRange; 
286
    String aString =  ReadHlinkRecord( rStrm );
287
288
    if ( aString.Len() )
289
        rRoot.GetXFRangeBuffer().SetHyperlink( aXclRange, aString );
290
}
291
292
String XclImpHyperlink::ReadHlinkRecord( XclImpStream& rStrm )
293
{
284
    DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 );
294
    DBG_ASSERT_BIFF( rRoot.GetBiff() == EXC_BIFF8 );
285
295
296
    const XclImpRoot& rRoot = rStrm.GetRoot();
286
    ScDocument& rDoc = rRoot.GetDoc();
297
    ScDocument& rDoc = rRoot.GetDoc();
287
    SfxObjectShell* pDocShell = rRoot.GetDocShell();
298
    SfxObjectShell* pDocShell = rRoot.GetDocShell();
288
299
289
    XclRange aXclRange( ScAddress::UNINITIALIZED );
290
    sal_uInt32 nFlags;
300
    sal_uInt32 nFlags;
291
    XclGuid aGuid;
301
    XclGuid aGuid;
292
302
    rStrm >> aGuid;
293
    rStrm >> aXclRange >> aGuid;
294
    rStrm.Ignore( 4 );
303
    rStrm.Ignore( 4 );
295
    rStrm >> nFlags;
304
    rStrm >> nFlags;
296
305
Lines 384-391 void XclImpHyperlink::ReadHlink( XclImpS Link Here
384
            xLongName->Append( '#' );
393
            xLongName->Append( '#' );
385
            xLongName->Append( *xTextMark );
394
            xLongName->Append( *xTextMark );
386
        }
395
        }
387
        rRoot.GetXFRangeBuffer().SetHyperlink( aXclRange, *xLongName );
388
    }
396
    }
397
    return *xLongName;
389
}
398
}
390
399
391
void XclImpHyperlink::InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl )
400
void XclImpHyperlink::InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl )
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/excel/xiescher.cxx (-15 / +45 lines)
Lines 1387-1416 SdrObject* XclImpDffManager::ProcessObj( Link Here
1387
    /*  Connect textbox data (string, alignment, text orientation) to object.
1387
    /*  Connect textbox data (string, alignment, text orientation) to object.
1388
        #98132# don't ask for a text-ID, Escher export doesn't set one. */
1388
        #98132# don't ask for a text-ID, Escher export doesn't set one. */
1389
    XclImpDrawingObj* pDrawingObj = dynamic_cast< XclImpDrawingObj* >( xDrawObj.get() );
1389
    XclImpDrawingObj* pDrawingObj = dynamic_cast< XclImpDrawingObj* >( xDrawObj.get() );
1390
1390
    if( pDrawingObj )
1391
    if( pDrawingObj )
1391
        pDrawingObj->SetTxoData( mrObjManager.FindTxoData( rObjData.rSpHd ) );
1392
        pDrawingObj->SetTxoData( mrObjManager.FindTxoData( rObjData.rSpHd ) );
1392
1393
1394
    // Generic shape bits hyper & macro
1395
    if ( xSdrObj.get() )
1396
    {
1397
        String sHlinkURL = ReadHlinkProperty( rEscherStrm );
1398
        if ( sHlinkURL.Len() )
1399
        {
1400
            ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE );
1401
            if ( pInfo )
1402
                pInfo->SetHlink( sHlinkURL );
1403
        }
1404
        if ( xDrawObj->GetMacroName().Len() )
1405
        {
1406
            ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE );
1407
            if ( pInfo )
1408
                pInfo->SetMacro( XclTbxControlHelper::GetScMacroName( xDrawObj->GetMacroName() ) );
1409
        }
1410
    }
1393
    // #118052# import internal name of a control
1411
    // #118052# import internal name of a control
1394
    if( XclImpOleObj* pOleObj = dynamic_cast< XclImpOleObj* >( xDrawObj.get() ) )
1412
    if( XclImpOleObj* pOleObj = dynamic_cast< XclImpOleObj* >( xDrawObj.get() ) )
1395
    {
1413
    {
1396
        String aName( ReadStringProperty( rEscherStrm, DFF_Prop_wzName ) );
1414
        String aName( ReadStringProperty( rEscherStrm, DFF_Prop_wzName ) );
1397
        if( aName.Len() )
1415
        if( aName.Len() )
1398
            pOleObj->SetControlName( aName );
1416
            pOleObj->SetControlName( aName );
1399
    }
1417
	
1400
    else
1401
    {
1402
        // its a drawing object or form control
1403
        if ( pDrawingObj && xSdrObj.get() )
1404
        {
1405
            if ( pDrawingObj->GetMacroName().Len() ) // has associated macro
1406
            {
1407
                ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( xSdrObj.get(), TRUE );
1408
		DBG_ASSERT( pInfo, "shape macro info could not be created!" );
1409
1410
                if ( pInfo )
1411
                    pInfo->SetMacro( XclTbxControlHelper::GetScMacroName(pDrawingObj->GetMacroName() ) );
1412
            }
1413
        }
1414
    }
1418
    }
1415
1419
1416
    // try to create a custom SdrObject that overwrites the passed object
1420
    // try to create a custom SdrObject that overwrites the passed object
Lines 1479-1484 FASTBOOL XclImpDffManager::GetColorFromP Link Here
1479
}
1483
}
1480
1484
1481
// private --------------------------------------------------------------------
1485
// private --------------------------------------------------------------------
1486
String XclImpDffManager::ReadHlinkProperty( SvStream& rEscherStrm ) const
1487
{
1488
    String aString;
1489
    sal_uInt32 nPropId = DFF_Prop_pihlShape;
1490
    sal_uInt32 nBufferSize = GetPropertyValue( nPropId );
1491
    if( (nBufferSize > 0) && SeekToContent( nPropId, rEscherStrm ) )
1492
    {
1493
        const static sal_uInt16 nDummyId = 9999;
1494
	sal_uInt16 nRecSize = nBufferSize;
1495
        SvMemoryStream memStream;
1496
        
1497
        memStream << nDummyId;
1498
        memStream << nRecSize; 	
1499
        for ( sal_Int32 nByteCount = 0; nByteCount < nRecSize; ++nByteCount )
1500
        {
1501
            sal_uInt8 aByte = 0;
1502
            rEscherStrm >> aByte;
1503
            memStream << aByte;
1504
        }
1505
        XclImpStream aLinkStream( memStream, GetRoot() );
1506
        aLinkStream.StartNextRecord();
1507
        XclImpHyperlink aHlink;
1508
        aString = aHlink.ReadHlinkRecord( aLinkStream );
1509
    }
1510
    return aString;
1511
}
1482
1512
1483
String XclImpDffManager::ReadStringProperty( SvStream& rEscherStrm, sal_uInt32 nPropId ) const
1513
String XclImpDffManager::ReadStringProperty( SvStream& rEscherStrm, sal_uInt32 nPropId ) const
1484
{
1514
{
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/filter/inc/xicontent.hxx (+1 lines)
Lines 98-103 public: Link Here
98
    /** Reads a HLINK record and inserts it into the document.
98
    /** Reads a HLINK record and inserts it into the document.
99
        @descr  Import stream must be located at start of a HLINK record. */
99
        @descr  Import stream must be located at start of a HLINK record. */
100
    static void         ReadHlink( XclImpStream& rStrm );
100
    static void         ReadHlink( XclImpStream& rStrm );
101
    static String       ReadHlinkRecord( XclImpStream& rStrm );
101
102
102
    /** Inserts the URL into a range of cells. Does not modify value or formula cells. */
103
    /** Inserts the URL into a range of cells. Does not modify value or formula cells. */
103
    static void         InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl );
104
    static void         InsertUrl( const XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl );
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh2.cxx (+14 lines)
Lines 76-81 Link Here
76
#ifndef _SVDCAPT_HXX
76
#ifndef _SVDCAPT_HXX
77
#include <svx/svdocapt.hxx>
77
#include <svx/svdocapt.hxx>
78
#endif
78
#endif
79
#include "drwlayer.hxx"
80
#include "userdat.hxx"
79
81
80
USHORT ScGetFontWorkId();		// in drtxtob
82
USHORT ScGetFontWorkId();		// in drtxtob
81
83
Lines 209-217 void ScDrawShell::GetDrawFuncState( SfxI Link Here
209
	}
211
	}
210
212
211
	BOOL bCanRename = FALSE;
213
	BOOL bCanRename = FALSE;
214
	if ( nMarkCount > 1 ) // no hypelink options for a selected group
215
	{
216
		rSet.DisableItem( SID_EDITLNK_ATTR_DLG );
217
		rSet.DisableItem( SID_DELLNK );
218
		rSet.DisableItem( SID_OPENLNK );
219
	}
212
	if ( nMarkCount == 1 )
220
	if ( nMarkCount == 1 )
213
	{
221
	{
214
        SdrObject* pObj = rMarkList.GetMark( 0 )->GetObj();
222
        SdrObject* pObj = rMarkList.GetMark( 0 )->GetObj();
223
	ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
224
	if ( !pInfo || ( pInfo &&  pInfo->GetHlink().getLength() == 0 ) )
225
	{
226
		rSet.DisableItem( SID_DELLNK );
227
		rSet.DisableItem( SID_OPENLNK );
228
	}
215
        SdrLayerID nLayerID = pObj->GetLayer();
229
        SdrLayerID nLayerID = pObj->GetLayer();
216
        if ( nLayerID != SC_LAYER_INTERN )
230
        if ( nLayerID != SC_LAYER_INTERN )
217
            bCanRename = TRUE;                          // #i51351# anything except internal objects can be renamed
231
            bCanRename = TRUE;                          // #i51351# anything except internal objects can be renamed
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh5.cxx (-2 / +16 lines)
Lines 105-110 void ScDrawShell::GetHLinkState( SfxItem Link Here
105
    {
105
    {
106
        SdrObject* pObj = rMarkList.GetMark(0)->GetObj();
106
        SdrObject* pObj = rMarkList.GetMark(0)->GetObj();
107
        SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
107
        SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
108
        ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
109
        if ( pInfo && pInfo->GetHlink().getLength() )
110
        {
111
            aHLinkItem.SetURL( pInfo->GetHlink() );
112
            aHLinkItem.SetInsertMode(HLINK_FIELD);
113
        }
108
        if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
114
        if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
109
        {
115
        {
110
            uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
116
            uno::Reference<awt::XControlModel> xControlModel = pUnoCtrl->GetUnoControlModel();
Lines 183-195 void ScDrawShell::ExecuteHLink( SfxReque Link Here
183
                    SvxLinkInsertMode eMode = pHyper->GetInsertMode();
189
                    SvxLinkInsertMode eMode = pHyper->GetInsertMode();
184
190
185
                    BOOL bDone = FALSE;
191
                    BOOL bDone = FALSE;
186
                    if ( eMode == HLINK_DEFAULT || eMode == HLINK_BUTTON )
192
                    if ( eMode == HLINK_FIELD || eMode == HLINK_BUTTON )
187
                    {
193
                    {
188
                        ScDrawView* pView = pViewData->GetScDrawView();
194
                        ScDrawView* pView = pViewData->GetScDrawView();
189
                        const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
195
                        const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
190
                        if ( rMarkList.GetMarkCount() == 1 )
196
                        if ( rMarkList.GetMarkCount() == 1 )
191
                        {
197
                        {
192
                            SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, rMarkList.GetMark(0)->GetObj());
198
                            SdrObject* pObj = rMarkList.GetMark(0)->GetObj();
199
200
                            SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj );
193
                            if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
201
                            if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
194
                            {
202
                            {
195
                                uno::Reference<awt::XControlModel> xControlModel =
203
                                uno::Reference<awt::XControlModel> xControlModel =
Lines 239-244 void ScDrawShell::ExecuteHLink( SfxReque Link Here
239
                                    bDone = TRUE;
247
                                    bDone = TRUE;
240
                                }
248
                                }
241
                            }
249
                            }
250
                            else
251
                            {
252
                                SetHlinkForObject( pObj, rURL );
253
                                bDone = TRUE;
254
                            }
255
 
242
                        }
256
                        }
243
                    }
257
                    }
244
258
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/drawsh.cxx (+47 lines)
Lines 294-299 Link Here
294
#include <sfx2/app.hxx>
294
#include <sfx2/app.hxx>
295
#include <sfx2/objface.hxx>
295
#include <sfx2/objface.hxx>
296
#include <sfx2/request.hxx>
296
#include <sfx2/request.hxx>
297
#include <sfx2/dispatch.hxx>
298
297
#include <svtools/whiter.hxx>
299
#include <svtools/whiter.hxx>
298
#include <vcl/msgbox.hxx>
300
#include <vcl/msgbox.hxx>
299
301
Lines 467-472 void ScDrawShell::ExecDrawAttr( SfxReque Link Here
467
		case SID_DRAWTEXT_ATTR_DLG:
469
		case SID_DRAWTEXT_ATTR_DLG:
468
			ExecuteTextAttrDlg( rReq );
470
			ExecuteTextAttrDlg( rReq );
469
			break;
471
			break;
472
		case SID_EDITLNK_ATTR_DLG:
473
			{
474
				if ( pSingleSelectedObj )
475
					pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
476
				break;
477
			}
478
		case SID_DELLNK:
479
			{
480
				if ( pSingleSelectedObj )
481
					SetHlinkForObject( pSingleSelectedObj, rtl::OUString() );
482
				break;
483
			}
484
		case SID_OPENLNK:
485
			{
486
				if ( nMarkCount == 1 )
487
				{
488
					SdrObject* pObj = rMarkList.GetMark( 0 )->GetObj();	
489
490
					if ( pObj->IsGroupObject() )
491
					{
492
						SdrPageView* pPV = NULL;
493
						SdrObject* pHit = NULL;
494
						if ( pView->PickObj( pWin->PixelToLogic( pViewData->GetMousePosPixel() ), pHit, pPV, SDRSEARCH_DEEP ) ) 
495
							pObj = pHit;
496
					}					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
497
					if ( pInfo && pInfo->GetHlink().getLength() )
498
					{
499
						rtl::OUString sURL = pInfo->GetHlink();
500
						rtl::OUString  sTarget = sURL;
501
						ScGlobal::OpenURL( sURL, sTarget );
502
					}
503
	
504
				}
505
				break;
506
			}
470
507
471
		case SID_ATTR_TRANSFORM:
508
		case SID_ATTR_TRANSFORM:
472
			{
509
			{
Lines 702-705 void ScDrawShell::ExecuteTextAttrDlg( Sf Link Here
702
	delete( pDlg );
732
	delete( pDlg );
703
}
733
}
704
734
735
void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
736
{
737
	if ( !pObj )
738
		return;
739
	ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
740
	pInfo->SetHlink( rHlnk );
741
	lcl_setModified( GetObjectShell() );
742
}
743
744
705
745
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/fudraw.cxx (-3 / +1 lines)
Lines 894-903 void FuDraw::ForcePointer(const MouseEve Link Here
894
			SdrObjMacroHitRec aHitRec;	//! muss da noch irgendwas gesetzt werden ????
894
			SdrObjMacroHitRec aHitRec;	//! muss da noch irgendwas gesetzt werden ????
895
			pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
895
			pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
896
		}
896
		}
897
		else  if ( !bAlt && pInfo && pInfo->GetMacro().getLength() )
897
		else  if ( !bAlt && pInfo && pInfo->GetMacro().getLength() | pInfo->GetHlink().getLength() )
898
		{
899
			pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
898
			pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
900
		}	
901
		else if ( IsDetectiveHit( aPnt ) )
899
		else if ( IsDetectiveHit( aPnt ) )
902
			pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
900
			pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
903
		else
901
		else
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/fusel.cxx (-7 / +24 lines)
Lines 191-199 BOOL __EXPORT FuSelection::MouseButtonDo Link Here
191
			else
191
			else
192
			{
192
			{
193
193
194
				String sURL;
195
				String sTarget;
196
194
				if ( !bAlt && pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER))
197
				if ( !bAlt && pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER))
195
				{
198
				{
196
197
					// Support for imported Excel docs
199
					// Support for imported Excel docs
198
					// Excel is of course not consistent and allows
200
					// Excel is of course not consistent and allows
199
					// a hyperlink to be assigned for an object group
201
					// a hyperlink to be assigned for an object group
Lines 218-224 BOOL __EXPORT FuSelection::MouseButtonDo Link Here
218
					}
220
					}
219
221
220
					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
222
					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
221
					if ( pInfo->GetMacro().getLength() )
223
224
					// For interoperability favour links over 
225
					// macros if both are defined
226
					if ( pInfo->GetHlink().getLength() )
227
					{
228
						OSL_TRACE("** Got URL");
229
						sURL = pInfo->GetHlink();
230
						sTarget = sURL;
231
					}
232
					else if ( pInfo->GetMacro().getLength() )
222
					{
233
					{
223
						SfxObjectShell* pObjSh = SfxObjectShell::Current();
234
						SfxObjectShell* pObjSh = SfxObjectShell::Current();
224
						if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
235
						if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
Lines 237-242 BOOL __EXPORT FuSelection::MouseButtonDo Link Here
237
					}
248
					}
238
				}
249
				}
239
250
251
240
				//	URL / ImageMap
252
				//	URL / ImageMap
241
253
242
				SdrViewEvent aVEvt;
254
				SdrViewEvent aVEvt;
Lines 250-265 BOOL __EXPORT FuSelection::MouseButtonDo Link Here
250
								ScDrawLayer::GetHitIMapObject( aVEvt.pObj, aMDPos, *pWindow );
262
								ScDrawLayer::GetHitIMapObject( aVEvt.pObj, aMDPos, *pWindow );
251
						if ( pIMapObj && pIMapObj->GetURL().Len() )
263
						if ( pIMapObj && pIMapObj->GetURL().Len() )
252
						{
264
						{
253
							ScGlobal::OpenURL( pIMapObj->GetURL(), pIMapObj->GetTarget() );
265
							sURL = pIMapObj->GetURL();
266
							sTarget =  pIMapObj->GetTarget();
254
267
255
							pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
256
							return TRUE;		// kein CaptureMouse etc.
257
						}
268
						}
258
					}
269
					}
259
					if ( aVEvt.eEvent == SDREVENT_EXECUTEURL && aVEvt.pURLField )	// URL
270
					if ( aVEvt.eEvent == SDREVENT_EXECUTEURL && aVEvt.pURLField )	// URL
260
					{
271
					{
261
						ScGlobal::OpenURL( aVEvt.pURLField->GetURL(),
272
						sURL = aVEvt.pURLField->GetURL();
262
											aVEvt.pURLField->GetTargetFrame() );
273
						sTarget = aVEvt.pURLField->GetTargetFrame();
274
275
					}
276
277
					if ( sURL.Len() )
278
					{
279
						ScGlobal::OpenURL( sURL, sTarget );
263
280
264
						pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
281
						pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
265
						return TRUE;		// kein CaptureMouse etc.
282
						return TRUE;		// kein CaptureMouse etc.
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/drawfunc/objdraw.src (+43 lines)
Lines 200-205 Link Here
200
        ITEM_FORMAT_PARA_DLG\
200
        ITEM_FORMAT_PARA_DLG\
201
    };
201
    };
202
202
203
#define MN_EDITLNK \
204
    MenuItem\
205
    {\
206
        Identifier = SID_EDITLNK_ATTR_DLG ; \
207
        HelpID = SID_EDITLNK_ATTR_DLG ; \
208
        Text [ de ] = "~Hyperlink..." ; \
209
        Text [ en-US ] = "~Hyperlink..." ; \
210
		Text [ x-comment ] = " ";\
211
	};
212
213
#define MN_DELLNK \
214
    MenuItem\
215
    {\
216
        Identifier = SID_DELLNK ; \
217
        HelpID = SID_DELLNK ; \
218
        Text [ de ] = "~Remove Hyperlink" ; \
219
        Text [ en-US ] = "~Remove Hyperlink" ; \
220
		Text [ x-comment ] = " ";\
221
	};
222
223
#define MN_OPENLNK \
224
    MenuItem\
225
    {\
226
        Identifier = SID_OPENLNK ; \
227
        HelpID = SID_OPENLNK ; \
228
        Text [ de ] = "~Open Hyperlink" ; \
229
        Text [ en-US ] = "~Open Hyperlink" ; \
230
		Text [ x-comment ] = " ";\
231
	};
232
203
#define MN_DRWTXTATTR \
233
#define MN_DRWTXTATTR \
204
    MenuItem\
234
    MenuItem\
205
    {\
235
    {\
Lines 400-405 Link Here
400
		Text [ x-comment ] = " ";\
430
		Text [ x-comment ] = " ";\
401
	};
431
	};
402
432
433
403
 //
434
 //
404
 //	------------------------------------------------------------------------------
435
 //	------------------------------------------------------------------------------
405
 //
436
 //
Lines 1295-1300 Menu RID_POPUP_DRAW Link Here
1295
		MenuItem { Separator = TRUE ; };
1326
		MenuItem { Separator = TRUE ; };
1296
		 //------------------------------
1327
		 //------------------------------
1297
		ITEM_GROUP_MENU
1328
		ITEM_GROUP_MENU
1329
		 //------------------------------
1330
		MenuItem { Separator = TRUE ; };
1331
		 //------------------------------
1332
		MN_EDITLNK // Edit H~yperlink...
1333
		MN_DELLNK  // ~Remove Hyperlink
1334
		MN_OPENLNK  // ~Open Hyperlink
1298
	};
1335
	};
1299
};
1336
};
1300
1337
Lines 1348-1353 Menu RID_POPUP_GRAPHIC Link Here
1348
		MenuItem { Separator = TRUE ; };
1385
		MenuItem { Separator = TRUE ; };
1349
		 //------------------------------
1386
		 //------------------------------
1350
		ITEM_GROUP_MENU
1387
		ITEM_GROUP_MENU
1388
		 //------------------------------
1389
		MenuItem { Separator = TRUE ; };
1390
		 //------------------------------
1391
		MN_EDITLNK // Edit H~yperlink...
1392
		MN_DELLNK  // ~Remove Hyperlink
1393
		MN_OPENLNK  // ~Open Hyperlink
1351
	   };
1394
	   };
1352
};
1395
};
1353
1396
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/inc/drawsh.hxx (+1 lines)
Lines 61-66 class ScDrawShell : public SfxShell Link Here
61
	ScViewData*	pViewData;
61
	ScViewData*	pViewData;
62
62
63
    DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
63
    DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
64
    void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
64
65
65
protected:
66
protected:
66
	ScViewData*	GetViewData()	{ return pViewData; }
67
	ScViewData*	GetViewData()	{ return pViewData; }
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/unoobj/shapeuno.cxx (-11 / +31 lines)
Lines 1342-1357 SdrObject* ScShapeObj::GetSdrObject() co Link Here
1342
1342
1343
typedef ::cppu::WeakImplHelper1< container::XNameReplace > ShapeUnoEventAcess_BASE;
1343
typedef ::cppu::WeakImplHelper1< container::XNameReplace > ShapeUnoEventAcess_BASE;
1344
const rtl::OUString sOnClick = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OnClick") );
1344
const rtl::OUString sOnClick = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OnClick") );
1345
const rtl::OUString sOnAction = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OnAction") );
1346
const rtl::OUString sURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("URL") );
1347
const rtl::OUString sAction = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Action") );
1345
const rtl::OUString sStrScript = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Script") );
1348
const rtl::OUString sStrScript = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Script") );
1346
const rtl::OUString sEventType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("EventType") );
1349
const rtl::OUString sEventType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("EventType") );
1347
1350
1351
const rtl::OUString sEventNames[] = { sOnClick, sOnAction };
1348
class ShapeUnoEventAccessImpl : public ShapeUnoEventAcess_BASE
1352
class ShapeUnoEventAccessImpl : public ShapeUnoEventAcess_BASE
1349
{
1353
{
1350
1354
1351
	ScShapeObj* mpShape;	
1355
	ScShapeObj* mpShape;	
1352
	bool isValidName( const rtl::OUString& aName )
1356
	bool isValidName( const rtl::OUString& aName )
1353
	{
1357
	{
1354
		return ( aName == sOnClick );
1358
		return ( aName == sOnClick | aName == sOnAction );
1355
	}
1359
	}
1356
	
1360
	
1357
	ScMacroInfo* getInfo( BOOL bCreate = false )
1361
	ScMacroInfo* getInfo( BOOL bCreate = false )
Lines 1390-1396 public: Link Here
1390
				isEventType = true;
1394
				isEventType = true;
1391
				continue;
1395
				continue;
1392
			}
1396
			}
1393
			if ( isEventType &&  pProperties->Name == sStrScript )
1397
			if ( isEventType && ( pProperties->Name == sStrScript | pProperties->Name == sURL) )
1394
			{
1398
			{
1395
				rtl::OUString sValue;
1399
				rtl::OUString sValue;
1396
				if ( ! ( pProperties->Value >>= sValue ) )
1400
				if ( ! ( pProperties->Value >>= sValue ) )
Lines 1400-1406 public: Link Here
1400
				
1404
				
1401
				if ( !pInfo )
1405
				if ( !pInfo )
1402
					break;	
1406
					break;	
1403
				pInfo->SetMacro( sValue );	
1407
				if ( pProperties->Name == sStrScript )
1408
					pInfo->SetMacro( sValue );	
1409
				else
1410
					pInfo->SetHlink( sValue );
1404
			}	
1411
			}	
1405
1412
1406
		}
1413
		}
Lines 1415-1435 public: Link Here
1415
		ScMacroInfo* pInfo = getInfo();
1422
		ScMacroInfo* pInfo = getInfo();
1416
		uno::Sequence< beans::PropertyValue > aProperties;
1423
		uno::Sequence< beans::PropertyValue > aProperties;
1417
		if ( pInfo )
1424
		if ( pInfo )
1418
		{
1425
			if ( aName == sOnClick )
1419
			if ( pInfo->GetMacro().getLength() )
1420
			{
1426
			{
1421
				aProperties.realloc(2);
1427
				if ( pInfo->GetMacro().getLength() )
1422
				aProperties[ 0 ].Name = sEventType;
1428
				{
1423
				aProperties[ 0 ].Value <<= sStrScript;
1429
					aProperties.realloc(2);
1424
				aProperties[ 1 ].Name = sStrScript;
1430
					aProperties[ 0 ].Name = sEventType;
1425
				aProperties[ 1 ].Value <<= pInfo->GetMacro();	
1431
					aProperties[ 0 ].Value <<= sStrScript;
1432
					aProperties[ 1 ].Name = sStrScript;
1433
					aProperties[ 1 ].Value <<= pInfo->GetMacro();	
1434
				}
1426
			}
1435
			}
1436
			else
1437
			{
1438
				if ( pInfo->GetHlink().getLength() )	
1439
				{
1440
					aProperties.realloc(2);
1441
					aProperties[ 0 ].Name = sEventType;
1442
					aProperties[ 0 ].Value <<= sAction;
1443
					aProperties[ 1 ].Name = sURL;
1444
					aProperties[ 1 ].Value <<= pInfo->GetHlink();	
1445
				}
1446
				
1427
		}
1447
		}
1428
		return uno::makeAny( aProperties );
1448
		return uno::makeAny( aProperties );
1429
	}
1449
	}
1430
	virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames(  ) throw(uno::RuntimeException)
1450
	virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames(  ) throw(uno::RuntimeException)
1431
	{
1451
	{
1432
		uno::Sequence< rtl::OUString > aStr( &sOnClick, 1 );
1452
		uno::Sequence< rtl::OUString > aStr( sEventNames, 2 );
1433
		return aStr;
1453
		return aStr;
1434
	}
1454
	}
1435
1455
(-)/data4/sles/ooo-buildNow/ooo-build/build/ooc680-m5/sc/source/ui/view/gridwin5.cxx (+22 lines)
Lines 84-89 Link Here
84
#include "chgviset.hxx"
84
#include "chgviset.hxx"
85
#include "dbfunc.hxx"
85
#include "dbfunc.hxx"
86
#include "tabvwsh.hxx"
86
#include "tabvwsh.hxx"
87
#include "userdat.hxx"
87
88
88
89
89
// -----------------------------------------------------------------------
90
// -----------------------------------------------------------------------
Lines 340-345 void __EXPORT ScGridWindow::RequestHelp( Link Here
340
						aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
341
						aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
341
					}
342
					}
342
				}
343
				}
344
				SdrObject* pObj = NULL;
345
				SdrPageView* pPV = NULL;
346
				Point aMDPos = PixelToLogic( aPosPixel );
347
				if ( pDrView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER) )
348
				{
349
					if ( pObj->IsGroupObject() )
350
					{
351
							SdrObject* pHit = NULL;
352
							if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
353
								pObj = pHit;
354
					}
355
					ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );	
356
					if ( pInfo && pInfo->GetHlink().getLength() )
357
					{
358
						aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
359
						aHelpText = pInfo->GetHlink();
360
						
361
					}	
362
						
363
364
				}
343
				// URL in Textobjekt
365
				// URL in Textobjekt
344
				if ( !aHelpText.Len() && aVEvt.eEvent == SDREVENT_EXECUTEURL )
366
				if ( !aHelpText.Len() && aVEvt.eEvent == SDREVENT_EXECUTEURL )
345
				{
367
				{

Return to issue 66550