1 diff --git offapi/com/sun/star/drawing/Shape.idl offapi/com/sun/star/drawing/Shape.idl
2 index 536ab62..bc5a70f 100644
3 --- offapi/com/sun/star/drawing/Shape.idl
4 +++ offapi/com/sun/star/drawing/Shape.idl
5 @@ -195,6 +195,10 @@ published service Shape
8 [optional, property] long NavigationOrder;
10 + /** this property lets you get and set a hyperlink for this shape.
12 + [optional, property] string Hyperlink;
15 //=============================================================================
16 diff --git sc/inc/sc.hrc sc/inc/sc.hrc
17 index be881a4..152289f 100644
21 // #i59082# assign macro to shape
22 #define SID_ASSIGNMACRO (SC_VIEW_START + 95)
24 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
25 // #i66550# hyperlinks in shapes
26 #define SID_DRAW_HLINK_EDIT (SC_VIEW_START + 96)
27 #define SID_DRAW_HLINK_DELETE (SC_VIEW_START + 97)
30 // "Zoom / Synchronize sheets" in options dialog
31 #define SID_SC_OPT_SYNCZOOM (SC_VIEW_START + 98)
32 diff --git sc/inc/shapeuno.hxx sc/inc/shapeuno.hxx
33 index a628d28..10833bf 100644
34 --- sc/inc/shapeuno.hxx
35 +++ sc/inc/shapeuno.hxx
36 @@ -53,6 +53,7 @@ namespace com { namespace sun { namespace star {
38 struct SvEventDescription;
39 class ShapeUnoEventAccessImpl;
42 //------------------------------------------------------------------------
44 @@ -68,6 +69,7 @@ class ScShapeObj : public ::cppu::OWeakObject,
45 public ::com::sun::star::document::XEventsSupplier
48 +friend ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate );
49 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg;
50 // cached pointers to avoid repeated queryAggregation calls:
51 ::com::sun::star::beans::XPropertySet* pShapePropertySet;
52 diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
53 index 7d331e1..b2c45ac 100644
54 --- sc/inc/unonames.hxx
55 +++ sc/inc/unonames.hxx
57 #define SC_UNONAME_ANCHOR "Anchor"
58 #define SC_UNONAME_HORIPOS "HoriOrientPosition"
59 #define SC_UNONAME_VERTPOS "VertOrientPosition"
60 +// #i66550 HLINK_FOR_SHAPES
61 +#define SC_UNONAME_HYPERLINK "Hyperlink"
63 // other cell properties
64 #define SC_UNONAME_CHCOLHDR "ChartColumnAsLabel"
65 diff --git sc/inc/userdat.hxx sc/inc/userdat.hxx
66 index cba05d0..3099b87 100644
67 --- sc/inc/userdat.hxx
68 +++ sc/inc/userdat.hxx
69 @@ -101,16 +101,12 @@ public:
70 void SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; }
71 const rtl::OUString& GetMacro() const { return maMacro; }
73 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
74 void SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; }
75 const rtl::OUString& GetHlink() const { return maHlink; }
79 rtl::OUString maMacro;
80 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
81 rtl::OUString maHlink;
85 //-------------------------------------------------------------------------
86 diff --git sc/sdi/drawsh.sdi sc/sdi/drawsh.sdi
87 index b52250e..3c860f9 100644
90 @@ -229,9 +229,9 @@ interface TableDraw
91 SID_FONTWORK_CHARACTER_SPACING_DIALOG [ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ]
93 // ISSUE66550_HLINK_FOR_SHAPES
94 -// SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
95 -// SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
96 -// SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
97 + SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
98 + SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
99 + SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ]
103 diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi
104 index cca4416..9bf0630 100644
107 @@ -6397,55 +6397,55 @@ SfxVoidItem StandardFonts SID_STANDARD_FONTS
109 //--------------------------------------------------------------------------
110 // ISSUE66550_HLINK_FOR_SHAPES
111 -//SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT
115 -// AutoUpdate = FALSE,
116 -// Cachable = Cachable,
118 -// HasCoreId = FALSE,
119 -// HasDialog = TRUE,
120 -// ReadOnlyDoc = TRUE,
122 -// Container = FALSE,
123 -// RecordAbsolute = FALSE,
127 +SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT
131 + AutoUpdate = FALSE,
132 + Cachable = Cachable,
136 + ReadOnlyDoc = TRUE,
139 + RecordAbsolute = FALSE,
144 -// AccelConfig = TRUE,
145 -// MenuConfig = FALSE,
146 -// StatusBarConfig = FALSE,
147 -// ToolBoxConfig = FALSE,
148 -// GroupId = GID_DRAWING;
150 + AccelConfig = TRUE,
151 + MenuConfig = FALSE,
152 + StatusBarConfig = FALSE,
153 + ToolBoxConfig = FALSE,
154 + GroupId = GID_DRAWING;
157 //--------------------------------------------------------------------------
158 // ISSUE66550_HLINK_FOR_SHAPES
159 -//SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE
163 -// AutoUpdate = TRUE,
164 -// Cachable = Cachable,
166 -// HasCoreId = FALSE,
167 -// HasDialog = FALSE,
168 -// ReadOnlyDoc = TRUE,
170 -// Container = FALSE,
171 -// RecordAbsolute = FALSE,
176 -// AccelConfig = TRUE,
177 -// MenuConfig = FALSE,
178 -// StatusBarConfig = FALSE,
179 -// ToolBoxConfig = FALSE,
180 -// GroupId = GID_DRAWING;
182 +SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE
187 + Cachable = Cachable,
191 + ReadOnlyDoc = TRUE,
194 + RecordAbsolute = FALSE,
199 + AccelConfig = TRUE,
200 + MenuConfig = FALSE,
201 + StatusBarConfig = FALSE,
202 + ToolBoxConfig = FALSE,
203 + GroupId = GID_DRAWING;
206 //--------------------------------------------------------------------------
207 SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD
208 diff --git sc/source/filter/excel/xiescher.cxx sc/source/filter/excel/xiescher.cxx
209 index 4d6fddf..7b8f936 100644
210 --- sc/source/filter/excel/xiescher.cxx.old 2009-04-03 20:33:34.000000000 +0200
211 +++ sc/source/filter/excel/xiescher.cxx 2009-04-03 20:40:50.000000000 +0200
212 @@ -483,8 +483,8 @@ void XclImpDrawObjBase::ProcessSdrObject
215 // macro and hyperlink
216 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
217 - if( mbSimpleMacro && ((maMacroName.Len() > 0) || (maHyperlink.getLength() > 0)) )
218 + if( mbSimpleMacro && ((maMacroName.Len() > 0) ||
219 + (maHyperlink.Len() > 0)) )
221 if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) )
223 @@ -492,11 +492,6 @@ void XclImpDrawObjBase::ProcessSdrObject
224 pInfo->SetHlink( maHyperlink );
228 - if( mbSimpleMacro && (maMacroName.Len() > 0) )
229 - if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) )
230 - pInfo->SetMacro( XclControlHelper::GetScMacroName( maMacroName ) );
233 // call virtual function for object type specific processing
234 DoProcessSdrObj( rSdrObj );
235 diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
236 index 495b35a..b06fbdd 100644
237 --- sc/source/filter/xml/xmlexprt.cxx
238 +++ sc/source/filter/xml/xmlexprt.cxx
239 @@ -2514,7 +2514,34 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
244 + // #i66550 HLINK_FOR_SHAPES
245 + rtl::OUString sHlink;
246 + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
248 + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink;
250 + std::auto_ptr< SvXMLElementExport > pDrawA;
251 + // enlose shapes with <draw:a> element only if sHlink contains something
252 + if ( sHlink.getLength() > 0 )
254 + // need to get delete the attributes that are pre-loaded
255 + // for the shape export ( otherwise they will become
256 + // attributes of the draw:a element ) This *shouldn't*
257 + // affect performance adversely as there are only a
258 + // couple of attributes involved
259 + uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new SvXMLAttributeList( GetAttrList() ) );
262 + AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
263 + AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink);
264 + pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ) );
265 + // Attribute list has been cleared by previous operation
266 + // re-add pre-loaded attributes
267 + AddAttributeList( xSaveAttribs );
269 GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint);
271 IncrementProgressBar(sal_False);
274 diff --git sc/source/ui/drawfunc/drawsh.cxx sc/source/ui/drawfunc/drawsh.cxx
275 index 39c3d76..c657abf 100644
276 --- sc/source/ui/drawfunc/drawsh.cxx
277 +++ sc/source/ui/drawfunc/drawsh.cxx
278 @@ -210,7 +210,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
279 ExecuteTextAttrDlg( rReq );
282 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
283 case SID_DRAW_HLINK_EDIT:
284 if ( pSingleSelectedObj )
285 pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
286 @@ -238,7 +237,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
287 ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
292 case SID_ATTR_TRANSFORM:
294 @@ -490,7 +488,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ )
298 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
299 void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
302 @@ -500,5 +497,4 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk
303 lcl_setModified( GetObjectShell() );
308 diff --git sc/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx
309 index bd6f2a1..27bfc44 100644
310 --- sc/source/ui/drawfunc/drawsh2.cxx
311 +++ sc/source/ui/drawfunc/drawsh2.cxx
312 @@ -199,24 +199,20 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disablen
313 BOOL bCanRename = FALSE;
314 if ( nMarkCount > 1 )
316 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
317 // no hypelink options for a selected group
318 rSet.DisableItem( SID_DRAW_HLINK_EDIT );
319 rSet.DisableItem( SID_DRAW_HLINK_DELETE );
320 rSet.DisableItem( SID_OPEN_HYPERLINK );
323 else if ( nMarkCount == 1 )
325 SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
326 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
327 ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
328 if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
330 rSet.DisableItem( SID_DRAW_HLINK_DELETE );
331 rSet.DisableItem( SID_OPEN_HYPERLINK );
334 SdrLayerID nLayerID = pObj->GetLayer();
335 if ( nLayerID != SC_LAYER_INTERN )
336 bCanRename = TRUE; // #i51351# anything except internal objects can be renamed
337 diff --git sc/source/ui/drawfunc/drawsh5.cxx sc/source/ui/drawfunc/drawsh5.cxx
338 index 16e20a9..4fd06bf 100644
339 --- sc/source/ui/drawfunc/drawsh5.cxx
340 +++ sc/source/ui/drawfunc/drawsh5.cxx
341 @@ -95,14 +95,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
342 if ( nMarkCount == 1 ) // URL-Button markiert ?
344 SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
345 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
346 ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
347 if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
349 aHLinkItem.SetURL( pInfo->GetHlink() );
350 aHLinkItem.SetInsertMode(HLINK_FIELD);
353 SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
354 if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
356 @@ -245,13 +243,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
360 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
363 SetHlinkForObject( pObj, rURL );
370 diff --git sc/source/ui/drawfunc/fudraw.cxx sc/source/ui/drawfunc/fudraw.cxx
371 index 5c0460f..d060c2f 100644
372 --- sc/source/ui/drawfunc/fudraw.cxx
373 +++ sc/source/ui/drawfunc/fudraw.cxx
374 @@ -891,11 +891,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
375 SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ????
376 pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
378 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
379 else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) )
381 - else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) )
383 pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
384 else if ( IsDetectiveHit( aPnt ) )
385 pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
386 diff --git sc/source/ui/drawfunc/fusel.cxx sc/source/ui/drawfunc/fusel.cxx
387 index 41c3e60..57bb6ba 100644
388 --- sc/source/ui/drawfunc/fusel.cxx
389 +++ sc/source/ui/drawfunc/fusel.cxx
390 @@ -205,7 +205,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
393 ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
394 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
395 // For interoperability favour links over macros if both are defined
396 if ( pInfo->GetHlink().getLength() > 0 )
398 @@ -213,9 +212,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
399 sURL = pInfo->GetHlink();
401 else if ( pInfo->GetMacro().getLength() > 0 )
403 - if ( pInfo->GetMacro().getLength() > 0 )
406 SfxObjectShell* pObjSh = SfxObjectShell::Current();
407 if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
408 diff --git sc/source/ui/drawfunc/objdraw.src sc/source/ui/drawfunc/objdraw.src
409 index 53d70c1..a1986b1 100644
410 --- sc/source/ui/drawfunc/objdraw.src
411 +++ sc/source/ui/drawfunc/objdraw.src
413 ITEM_FORMAT_PARA_DLG\
416 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
421 HelpID = SID_DRAW_HLINK_DELETE ; \
422 Text [ en-US ] = "~Remove Hyperlink" ; \
426 #define MN_DRWTXTATTR \
428 @@ -1294,14 +1292,12 @@ Menu RID_POPUP_DRAW
429 MenuItem { Separator = TRUE ; };
430 //------------------------------
432 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
433 //------------------------------
434 MenuItem { Separator = TRUE ; };
435 //------------------------------
438 MenuItem { ITEM_OPEN_HYPERLINK };
443 @@ -1371,14 +1367,12 @@ Menu RID_POPUP_GRAPHIC
444 MenuItem { Separator = TRUE ; };
445 //------------------------------
447 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
448 //------------------------------
449 MenuItem { Separator = TRUE ; };
450 //------------------------------
453 MenuItem { ITEM_OPEN_HYPERLINK };
458 diff --git sc/source/ui/inc/drawsh.hxx sc/source/ui/inc/drawsh.hxx
459 index 20b150f..9435ec8 100644
460 --- sc/source/ui/inc/drawsh.hxx
461 +++ sc/source/ui/inc/drawsh.hxx
462 @@ -47,9 +47,7 @@ class ScDrawShell : public SfxShell
464 DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
466 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
467 void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk );
471 ScViewData* GetViewData() { return pViewData; }
472 diff --git sc/source/ui/unoobj/shapeuno.cxx sc/source/ui/unoobj/shapeuno.cxx
473 index 151acf8..1d8a944 100644
474 --- sc/source/ui/unoobj/shapeuno.cxx
475 +++ sc/source/ui/unoobj/shapeuno.cxx
476 @@ -72,6 +72,8 @@ const SfxItemPropertyMap* lcl_GetShapeMap()
477 {MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
478 {MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP), 0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 },
479 {MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 },
480 + // #i66550 HLINK_FOR_SHAPES
481 + {MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 },
484 return aShapeMap_Impl;
485 @@ -86,6 +88,14 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems()
487 return aMacroDescriptionsImpl;
489 +// #i66550 HLINK_FOR_SHAPES
490 +ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate = FALSE )
493 + if( SdrObject* pObj = pShape->GetSdrObject() )
494 + return ScDrawLayer::GetMacroInfo( pObj, bCreate );
498 //------------------------------------------------------------------------
500 @@ -627,6 +637,13 @@ void SAL_CALL ScShapeObj::setPropertyValue(
504 + else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) )
506 + rtl::OUString sHlink;
507 + ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, TRUE);
508 + if ( ( aValue >>= sHlink ) && pInfo )
509 + pInfo->SetHlink( sHlink );
513 GetShapePropertySet();
514 @@ -808,6 +825,13 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa
518 + else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) )
520 + rtl::OUString sHlink;
521 + if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) )
522 + sHlink = pInfo->GetHlink();
527 GetShapePropertySet();
528 @@ -1320,11 +1344,6 @@ SdrObject* ScShapeObj::GetSdrObject() const throw()
531 #define SC_EVENTACC_ONCLICK ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) )
532 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
533 -#define SC_EVENTACC_ONACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) )
534 -#define SC_EVENTACC_URL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) )
535 -#define SC_EVENTACC_ACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) )
537 #define SC_EVENTACC_SCRIPT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) )
538 #define SC_EVENTACC_EVENTTYPE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) )
540 @@ -1336,10 +1355,7 @@ private:
542 ScMacroInfo* getInfo( BOOL bCreate = FALSE )
545 - if( SdrObject* pObj = mpShape->GetSdrObject() )
546 - return ScDrawLayer::GetMacroInfo( pObj, bCreate );
548 + return lcl_getShapeHyperMacroInfo( mpShape, bCreate );
552 @@ -1365,11 +1381,7 @@ public:
556 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
557 - if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) )
559 if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) )
562 rtl::OUString sValue;
563 if ( pProperties->Value >>= sValue )
564 @@ -1380,10 +1392,8 @@ public:
566 if ( pProperties->Name == SC_EVENTACC_SCRIPT )
567 pInfo->SetMacro( sValue );
568 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
570 pInfo->SetHlink( sValue );
575 @@ -1406,19 +1416,6 @@ public:
576 aProperties[ 1 ].Value <<= pInfo->GetMacro();
579 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
580 - else if( aName == SC_EVENTACC_ONACTION )
582 - if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
584 - aProperties.realloc( 2 );
585 - aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE;
586 - aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION;
587 - aProperties[ 1 ].Name = SC_EVENTACC_URL;
588 - aProperties[ 1 ].Value <<= pInfo->GetHlink();
594 throw container::NoSuchElementException();
595 @@ -1429,25 +1426,14 @@ public:
597 virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException)
599 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
600 - uno::Sequence< rtl::OUString > aSeq( 2 );
602 uno::Sequence< rtl::OUString > aSeq( 1 );
604 aSeq[ 0 ] = SC_EVENTACC_ONCLICK;
605 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
606 - aSeq[ 1 ] = SC_EVENTACC_ONACTION;
611 virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException)
613 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
614 - return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION);
616 return aName == SC_EVENTACC_ONCLICK;
621 diff --git sc/source/ui/view/gridwin5.cxx sc/source/ui/view/gridwin5.cxx
622 index 81ef0df..57797eb 100644
623 --- sc/source/ui/view/gridwin5.cxx
624 +++ sc/source/ui/view/gridwin5.cxx
625 @@ -345,14 +345,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
626 if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
629 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
630 ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
631 if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
633 aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect());
634 aHelpText = pInfo->GetHlink();
640 diff --git xmloff/inc/xmloff/shapeexport.hxx xmloff/inc/xmloff/shapeexport.hxx
641 index bb3b369..bc331e8 100644
642 --- xmloff/inc/xmloff/shapeexport.hxx
643 +++ xmloff/inc/xmloff/shapeexport.hxx
644 @@ -197,11 +197,6 @@ private:
645 const rtl::OUString msStartShape;
646 const rtl::OUString msEndShape;
647 const rtl::OUString msOnClick;
648 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
649 - const rtl::OUString msOnAction;
650 - const rtl::OUString msAction;
651 - const rtl::OUString msURL;
653 const rtl::OUString msEventType;
654 const rtl::OUString msPresentation;
655 const rtl::OUString msMacroName;
656 diff --git xmloff/source/draw/eventimp.cxx xmloff/source/draw/eventimp.cxx
657 index 54c0683..57c8dee 100644
658 --- xmloff/source/draw/eventimp.cxx
659 +++ xmloff/source/draw/eventimp.cxx
660 @@ -104,9 +104,6 @@ public:
664 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
665 - sal_Bool mbActionEvent;
667 ClickAction meClickAction;
669 XMLEffectDirection meDirection;
670 @@ -118,9 +115,6 @@ public:
671 OUString msMacroName;
674 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
675 - OUString msHyperURL;
679 ///////////////////////////////////////////////////////////////////////
680 @@ -179,18 +173,11 @@ TYPEINIT1( SdXMLEventContext, SvXMLImportContext );
682 SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape )
683 : SvXMLImportContext(rImp, nPrfx, rLocalName),
684 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
685 - mxShape( rxShape ), mbScript( sal_False ), mbActionEvent( sal_False ), meClickAction( ClickAction_NONE ),
687 mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ),
689 meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ),
690 meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False )
692 static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) );
693 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
694 - static const OUString sXMLActionName( RTL_CONSTASCII_USTRINGPARAM( "action" ) );
697 if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) )
699 @@ -261,12 +248,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons
701 sal_uInt16 nScriptPrefix =
702 GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName );
703 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
704 - mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == sXMLClickName || sEventName == sXMLActionName );
705 - mbActionEvent = mbValid && (sEventName == sXMLActionName);
707 mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName;
710 else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) )
712 @@ -295,12 +277,6 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons
714 msMacroName = sValue;
716 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
717 - else if ( mbActionEvent )
719 - msHyperURL = sValue;
724 const rtl::OUString &rTmp =
725 @@ -346,26 +322,6 @@ void SdXMLEventContext::EndElement()
726 OUString sAPIEventName;
727 uno::Sequence< beans::PropertyValue > aProperties;
729 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
730 - if( mbActionEvent )
732 - sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) );
733 - aProperties.realloc( 2 );
734 - beans::PropertyValue* pProperty = aProperties.getArray();
736 - pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) );
737 - pProperty->Handle = -1;
738 - pProperty->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) );
739 - pProperty->State = beans::PropertyState_DIRECT_VALUE;
741 - pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) );
742 - pProperty->Handle = -1;
743 - pProperty->Value <<= msHyperURL;
744 - pProperty->State = beans::PropertyState_DIRECT_VALUE;
749 sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) );
752 @@ -550,8 +506,6 @@ void SdXMLEventContext::EndElement()
758 xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) );
761 diff --git xmloff/source/draw/shapeexport.cxx xmloff/source/draw/shapeexport.cxx
762 index 4691d72..0bfa0cb 100644
763 --- xmloff/source/draw/shapeexport.cxx
764 +++ xmloff/source/draw/shapeexport.cxx
765 @@ -87,11 +87,6 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp,
766 msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
767 msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
768 msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ),
769 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
770 - msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ),
771 - msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ),
772 - msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ),
774 msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ),
775 msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ),
776 msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ),
777 diff --git xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport2.cxx
778 index c3594a6..d7005be 100644
779 --- xmloff/source/draw/shapeexport2.cxx
780 +++ xmloff/source/draw/shapeexport2.cxx
781 @@ -296,9 +296,6 @@ const sal_Int32 FOUND_CLICKEVENTTYPE = 0x00000080;
782 const sal_Int32 FOUND_MACRO = 0x00000100;
783 const sal_Int32 FOUND_LIBRARY = 0x00000200;
784 const sal_Int32 FOUND_ACTIONEVENTTYPE = 0x00000400;
785 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
786 -const sal_Int32 FOUND_URL = 0x00000800;
791 @@ -388,33 +385,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
795 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
796 - // extract properties from "OnAction" event -------------------------------
798 - OUString aActionEventType;
799 - OUString aHyperURL;
801 - uno::Sequence< beans::PropertyValue > aActionProperties;
802 - if( xEvents->hasByName( msOnAction ) && (xEvents->getByName( msOnAction ) >>= aActionProperties) )
804 - const beans::PropertyValue* pProperty = aActionProperties.getConstArray();
805 - const beans::PropertyValue* pPropertyEnd = pProperty + aActionProperties.getLength();
806 - for( ; pProperty != pPropertyEnd; ++pProperty )
808 - if( ( ( nFound & FOUND_ACTIONEVENTTYPE ) == 0 ) && pProperty->Name == msEventType )
810 - if( pProperty->Value >>= aActionEventType )
811 - nFound |= FOUND_ACTIONEVENTTYPE;
813 - else if( ( ( nFound & FOUND_URL ) == 0 ) && ( pProperty->Name == msURL ) )
815 - if( pProperty->Value >>= aHyperURL )
816 - nFound |= FOUND_URL;
822 // create the XML elements
824 if( aClickEventType == msPresentation )
825 @@ -566,15 +536,9 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
826 SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
829 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
830 - else if( aClickEventType == msScript || aActionEventType == msAction )
832 - if( nFound & ( FOUND_MACRO | FOUND_URL ) )
834 else if( aClickEventType == msScript )
836 if( nFound & FOUND_MACRO )
839 SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True);
840 if ( nFound & FOUND_MACRO )
841 @@ -589,18 +553,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x
843 SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True);
845 -#ifdef ISSUE66550_HLINK_FOR_SHAPES
846 - if ( nFound & FOUND_URL )
848 - OUString aEventQName(
849 - mrExport.GetNamespaceMap().GetQNameByKey(
850 - XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) );
851 - mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName );
852 - mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL );
854 - SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True);
860 diff --git xmloff/source/draw/ximpshap.cxx xmloff/source/draw/ximpshap.cxx
861 index 5d1d0da..c461d59 100644
862 --- xmloff/source/draw/ximpshap.cxx
863 +++ xmloff/source/draw/ximpshap.cxx
864 @@ -375,6 +375,11 @@ void SdXMLShapeContext::EndElement()
866 if( msHyperlink.getLength() != 0 ) try
868 + uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY );
870 + rtl::OUString sLink( RTL_CONSTASCII_USTRINGPARAM( "Hyperlink" ) );
871 + if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( sLink ) )
872 + xProp->setPropertyValue( sLink, uno::Any( msHyperlink ) );
873 Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW );
874 Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW );
876 @@ -3230,9 +3235,16 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( USHORT nPrefix,
878 if( !mxImplContext.Is() )
880 - pContext = GetImport().GetShapeImport()->CreateFrameChildContext(
882 + SvXMLShapeContext* pShapeContext= GetImport().GetShapeImport()->CreateFrameChildContext(
883 GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList );
885 + pContext = pShapeContext;
887 + // propagate the hyperlink to child context
888 + if ( msHyperlink.getLength() > 0 )
889 + pShapeContext->setHyperlink( msHyperlink );
891 mxImplContext = pContext;
892 mbSupportsReplacement = IsXMLToken( rLocalName, XML_OBJECT ) ||
893 IsXMLToken( rLocalName, XML_OBJECT_OLE );