diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-01-28 21:26:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-01-28 21:26:09 +0100 |
commit | 7947d959db2a84860cdfd479d95ea5b30fdba051 (patch) | |
tree | 4cc2ec4d16ee75d338f85d966b089ca5a0240097 /patches/dev300/vba-sc-autoshapes-hyperlinks.diff | |
parent | 2786d0238b25d7bcc1408bb1a45a8f7f4bd1febd (diff) |
replace obsolete "master" branch with README that points at new repoHEADmaster-deletedmaster
Diffstat (limited to 'patches/dev300/vba-sc-autoshapes-hyperlinks.diff')
-rw-r--r-- | patches/dev300/vba-sc-autoshapes-hyperlinks.diff | 893 |
1 files changed, 0 insertions, 893 deletions
diff --git a/patches/dev300/vba-sc-autoshapes-hyperlinks.diff b/patches/dev300/vba-sc-autoshapes-hyperlinks.diff deleted file mode 100644 index c418aadb8..000000000 --- a/patches/dev300/vba-sc-autoshapes-hyperlinks.diff +++ /dev/null @@ -1,893 +0,0 @@ -diff --git offapi/com/sun/star/drawing/Shape.idl offapi/com/sun/star/drawing/Shape.idl -index 536ab62..bc5a70f 100644 ---- offapi/com/sun/star/drawing/Shape.idl -+++ offapi/com/sun/star/drawing/Shape.idl -@@ -195,6 +195,10 @@ published service Shape - the z-order. - */ - [optional, property] long NavigationOrder; -+ -+ /** this property lets you get and set a hyperlink for this shape. -+ */ -+ [optional, property] string Hyperlink; - }; - - //============================================================================= -diff --git sc/inc/sc.hrc sc/inc/sc.hrc -index be881a4..152289f 100644 ---- sc/inc/sc.hrc -+++ sc/inc/sc.hrc -@@ -593,11 +593,9 @@ - // #i59082# assign macro to shape - #define SID_ASSIGNMACRO (SC_VIEW_START + 95) - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - // #i66550# hyperlinks in shapes - #define SID_DRAW_HLINK_EDIT (SC_VIEW_START + 96) - #define SID_DRAW_HLINK_DELETE (SC_VIEW_START + 97) --#endif - - // "Zoom / Synchronize sheets" in options dialog - #define SID_SC_OPT_SYNCZOOM (SC_VIEW_START + 98) -diff --git sc/inc/shapeuno.hxx sc/inc/shapeuno.hxx -index a628d28..10833bf 100644 ---- sc/inc/shapeuno.hxx -+++ sc/inc/shapeuno.hxx -@@ -53,6 +53,7 @@ namespace com { namespace sun { namespace star { - class SdrObject; - struct SvEventDescription; - class ShapeUnoEventAccessImpl; -+class ScMacroInfo; - - //------------------------------------------------------------------------ - -@@ -68,6 +69,7 @@ class ScShapeObj : public ::cppu::OWeakObject, - public ::com::sun::star::document::XEventsSupplier - { - private: -+friend ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate ); - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg; - // cached pointers to avoid repeated queryAggregation calls: - ::com::sun::star::beans::XPropertySet* pShapePropertySet; -diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx -index 7d331e1..b2c45ac 100644 ---- sc/inc/unonames.hxx -+++ sc/inc/unonames.hxx -@@ -182,6 +182,8 @@ - #define SC_UNONAME_ANCHOR "Anchor" - #define SC_UNONAME_HORIPOS "HoriOrientPosition" - #define SC_UNONAME_VERTPOS "VertOrientPosition" -+// #i66550 HLINK_FOR_SHAPES -+#define SC_UNONAME_HYPERLINK "Hyperlink" - - // other cell properties - #define SC_UNONAME_CHCOLHDR "ChartColumnAsLabel" -diff --git sc/inc/userdat.hxx sc/inc/userdat.hxx -index cba05d0..3099b87 100644 ---- sc/inc/userdat.hxx -+++ sc/inc/userdat.hxx -@@ -101,16 +101,12 @@ public: - void SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; } - const rtl::OUString& GetMacro() const { return maMacro; } - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - void SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; } - const rtl::OUString& GetHlink() const { return maHlink; } --#endif - - private: - rtl::OUString maMacro; --#ifdef ISSUE66550_HLINK_FOR_SHAPES - rtl::OUString maHlink; --#endif - }; - - //------------------------------------------------------------------------- -diff --git sc/sdi/drawsh.sdi sc/sdi/drawsh.sdi -index b52250e..3c860f9 100644 ---- sc/sdi/drawsh.sdi -+++ sc/sdi/drawsh.sdi -@@ -229,9 +229,9 @@ interface TableDraw - SID_FONTWORK_CHARACTER_SPACING_DIALOG [ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ] - - // ISSUE66550_HLINK_FOR_SHAPES --// SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] --// SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] --// SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -+ SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -+ SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -+ SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] - } - - -diff --git sc/sdi/scalc.sdi sc/sdi/scalc.sdi -index cca4416..9bf0630 100644 ---- sc/sdi/scalc.sdi -+++ sc/sdi/scalc.sdi -@@ -6397,55 +6397,55 @@ SfxVoidItem StandardFonts SID_STANDARD_FONTS - - //-------------------------------------------------------------------------- - // ISSUE66550_HLINK_FOR_SHAPES --//SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT --//() --//[ --// /* flags: */ --// AutoUpdate = FALSE, --// Cachable = Cachable, --// FastCall = TRUE, --// HasCoreId = FALSE, --// HasDialog = TRUE, --// ReadOnlyDoc = TRUE, --// Toggle = FALSE, --// Container = FALSE, --// RecordAbsolute = FALSE, --// RecordPerSet; --// Synchron; --// -+SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT -+() -+[ -+ /* flags: */ -+ AutoUpdate = FALSE, -+ Cachable = Cachable, -+ FastCall = TRUE, -+ HasCoreId = FALSE, -+ HasDialog = TRUE, -+ ReadOnlyDoc = TRUE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ - // /* config: */ --// AccelConfig = TRUE, --// MenuConfig = FALSE, --// StatusBarConfig = FALSE, --// ToolBoxConfig = FALSE, --// GroupId = GID_DRAWING; --//] -+ AccelConfig = TRUE, -+ MenuConfig = FALSE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_DRAWING; -+] - - //-------------------------------------------------------------------------- - // ISSUE66550_HLINK_FOR_SHAPES --//SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE --//() --//[ --// /* flags: */ --// AutoUpdate = TRUE, --// Cachable = Cachable, --// FastCall = TRUE, --// HasCoreId = FALSE, --// HasDialog = FALSE, --// ReadOnlyDoc = TRUE, --// Toggle = FALSE, --// Container = FALSE, --// RecordAbsolute = FALSE, --// RecordPerSet; --// Synchron; --// --// /* config: */ --// AccelConfig = TRUE, --// MenuConfig = FALSE, --// StatusBarConfig = FALSE, --// ToolBoxConfig = FALSE, --// GroupId = GID_DRAWING; --//] -+SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE -+() -+[ -+ /* flags: */ -+ AutoUpdate = TRUE, -+ Cachable = Cachable, -+ FastCall = TRUE, -+ HasCoreId = FALSE, -+ HasDialog = FALSE, -+ ReadOnlyDoc = TRUE, -+ Toggle = FALSE, -+ Container = FALSE, -+ RecordAbsolute = FALSE, -+ RecordPerSet; -+ Synchron; -+ -+ /* config: */ -+ AccelConfig = TRUE, -+ MenuConfig = FALSE, -+ StatusBarConfig = FALSE, -+ ToolBoxConfig = FALSE, -+ GroupId = GID_DRAWING; -+] - - //-------------------------------------------------------------------------- - SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD -diff --git sc/source/filter/excel/xiescher.cxx sc/source/filter/excel/xiescher.cxx -index 4d6fddf..7b8f936 100644 ---- sc/source/filter/excel/xiescher.cxx.old 2009-04-03 20:33:34.000000000 +0200 -+++ sc/source/filter/excel/xiescher.cxx 2009-04-03 20:40:50.000000000 +0200 -@@ -483,8 +483,8 @@ void XclImpDrawObjBase::ProcessSdrObject - } - - // macro and hyperlink --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if( mbSimpleMacro && ((maMacroName.Len() > 0) || (maHyperlink.getLength() > 0)) ) -+ if( mbSimpleMacro && ((maMacroName.Len() > 0) || -+ (maHyperlink.Len() > 0)) ) - { - if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) ) - { -@@ -492,11 +492,6 @@ void XclImpDrawObjBase::ProcessSdrObject - pInfo->SetHlink( maHyperlink ); - } - } --#else -- if( mbSimpleMacro && (maMacroName.Len() > 0) ) -- if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) ) -- pInfo->SetMacro( XclControlHelper::GetScMacroName( maMacroName ) ); --#endif - - // call virtual function for object type specific processing - DoProcessSdrObj( rSdrObj ); -diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx -index 495b35a..b06fbdd 100644 ---- sc/source/filter/xml/xmlexprt.cxx -+++ sc/source/filter/xml/xmlexprt.cxx -@@ -2514,7 +2514,34 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, - } - } - if (!bIsChart) -+ { -+ // #i66550 HLINK_FOR_SHAPES -+ rtl::OUString sHlink; -+ uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); -+ if ( xProps.is() ) -+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink; -+ -+ std::auto_ptr< SvXMLElementExport > pDrawA; -+ // enlose shapes with <draw:a> element only if sHlink contains something -+ if ( sHlink.getLength() > 0 ) -+ { -+ // need to get delete the attributes that are pre-loaded -+ // for the shape export ( otherwise they will become -+ // attributes of the draw:a element ) This *shouldn't* -+ // affect performance adversely as there are only a -+ // couple of attributes involved -+ uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new SvXMLAttributeList( GetAttrList() ) ); -+ ClearAttrList(); -+ // Add Hlink -+ AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); -+ AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink); -+ pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ) ); -+ // Attribute list has been cleared by previous operation -+ // re-add pre-loaded attributes -+ AddAttributeList( xSaveAttribs ); -+ } - GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint); -+ } - IncrementProgressBar(sal_False); - } - -diff --git sc/source/ui/drawfunc/drawsh.cxx sc/source/ui/drawfunc/drawsh.cxx -index 39c3d76..c657abf 100644 ---- sc/source/ui/drawfunc/drawsh.cxx -+++ sc/source/ui/drawfunc/drawsh.cxx -@@ -210,7 +210,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) - ExecuteTextAttrDlg( rReq ); - break; - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - case SID_DRAW_HLINK_EDIT: - if ( pSingleSelectedObj ) - pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG ); -@@ -238,7 +237,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) - ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() ); - } - break; --#endif - - case SID_ATTR_TRANSFORM: - { -@@ -490,7 +488,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ ) - delete( pDlg ); - } - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ) - { - if ( pObj ) -@@ -500,5 +497,4 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk - lcl_setModified( GetObjectShell() ); - } - } --#endif - -diff --git sc/source/ui/drawfunc/drawsh2.cxx sc/source/ui/drawfunc/drawsh2.cxx -index bd6f2a1..27bfc44 100644 ---- sc/source/ui/drawfunc/drawsh2.cxx -+++ sc/source/ui/drawfunc/drawsh2.cxx -@@ -199,24 +199,20 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disablen - BOOL bCanRename = FALSE; - if ( nMarkCount > 1 ) - { --#ifdef ISSUE66550_HLINK_FOR_SHAPES - // no hypelink options for a selected group - rSet.DisableItem( SID_DRAW_HLINK_EDIT ); - rSet.DisableItem( SID_DRAW_HLINK_DELETE ); - rSet.DisableItem( SID_OPEN_HYPERLINK ); --#endif - } - else if ( nMarkCount == 1 ) - { - SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( !pInfo || (pInfo->GetHlink().getLength() == 0) ) - { - rSet.DisableItem( SID_DRAW_HLINK_DELETE ); - rSet.DisableItem( SID_OPEN_HYPERLINK ); - } --#endif - SdrLayerID nLayerID = pObj->GetLayer(); - if ( nLayerID != SC_LAYER_INTERN ) - bCanRename = TRUE; // #i51351# anything except internal objects can be renamed -diff --git sc/source/ui/drawfunc/drawsh5.cxx sc/source/ui/drawfunc/drawsh5.cxx -index 16e20a9..4fd06bf 100644 ---- sc/source/ui/drawfunc/drawsh5.cxx -+++ sc/source/ui/drawfunc/drawsh5.cxx -@@ -95,14 +95,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink - if ( nMarkCount == 1 ) // URL-Button markiert ? - { - SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) - { - aHLinkItem.SetURL( pInfo->GetHlink() ); - aHLinkItem.SetInsertMode(HLINK_FIELD); - } --#endif - SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj); - if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor()) - { -@@ -245,13 +243,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq ) - bDone = TRUE; - } - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES - else - { - SetHlinkForObject( pObj, rURL ); - bDone = TRUE; - } --#endif - } - } - -diff --git sc/source/ui/drawfunc/fudraw.cxx sc/source/ui/drawfunc/fudraw.cxx -index 5c0460f..d060c2f 100644 ---- sc/source/ui/drawfunc/fudraw.cxx -+++ sc/source/ui/drawfunc/fudraw.cxx -@@ -891,11 +891,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) - SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ???? - pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) ); - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES - else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) ) --#else -- else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) ) --#endif - pWindow->SetPointer( Pointer( POINTER_REFHAND ) ); - else if ( IsDetectiveHit( aPnt ) ) - pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) ); -diff --git sc/source/ui/drawfunc/fusel.cxx sc/source/ui/drawfunc/fusel.cxx -index 41c3e60..57bb6ba 100644 ---- sc/source/ui/drawfunc/fusel.cxx -+++ sc/source/ui/drawfunc/fusel.cxx -@@ -205,7 +205,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt) - } - - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - // For interoperability favour links over macros if both are defined - if ( pInfo->GetHlink().getLength() > 0 ) - { -@@ -213,9 +212,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt) - sURL = pInfo->GetHlink(); - } - else if ( pInfo->GetMacro().getLength() > 0 ) --#else -- if ( pInfo->GetMacro().getLength() > 0 ) --#endif - { - SfxObjectShell* pObjSh = SfxObjectShell::Current(); - if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) ) -diff --git sc/source/ui/drawfunc/objdraw.src sc/source/ui/drawfunc/objdraw.src -index 53d70c1..a1986b1 100644 ---- sc/source/ui/drawfunc/objdraw.src -+++ sc/source/ui/drawfunc/objdraw.src -@@ -185,7 +185,6 @@ - ITEM_FORMAT_PARA_DLG\ - }; - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - #define MN_EDITLNK \ - MenuItem\ - {\ -@@ -201,7 +200,6 @@ - HelpID = SID_DRAW_HLINK_DELETE ; \ - Text [ en-US ] = "~Remove Hyperlink" ; \ - }; --#endif - - #define MN_DRWTXTATTR \ - MenuItem\ -@@ -1294,14 +1292,12 @@ Menu RID_POPUP_DRAW - MenuItem { Separator = TRUE ; }; - //------------------------------ - ITEM_GROUP_MENU --#ifdef ISSUE66550_HLINK_FOR_SHAPES - //------------------------------ - MenuItem { Separator = TRUE ; }; - //------------------------------ - MN_EDITLNK - MN_DELLNK - MenuItem { ITEM_OPEN_HYPERLINK }; --#endif - }; - }; - -@@ -1371,14 +1367,12 @@ Menu RID_POPUP_GRAPHIC - MenuItem { Separator = TRUE ; }; - //------------------------------ - ITEM_GROUP_MENU --#ifdef ISSUE66550_HLINK_FOR_SHAPES - //------------------------------ - MenuItem { Separator = TRUE ; }; - //------------------------------ - MN_EDITLNK - MN_DELLNK - MenuItem { ITEM_OPEN_HYPERLINK }; --#endif - }; - }; - -diff --git sc/source/ui/inc/drawsh.hxx sc/source/ui/inc/drawsh.hxx -index 20b150f..9435ec8 100644 ---- sc/source/ui/inc/drawsh.hxx -+++ sc/source/ui/inc/drawsh.hxx -@@ -47,9 +47,7 @@ class ScDrawShell : public SfxShell - - DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* ); - --#ifdef ISSUE66550_HLINK_FOR_SHAPES - void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ); --#endif - - protected: - ScViewData* GetViewData() { return pViewData; } -diff --git sc/source/ui/unoobj/shapeuno.cxx sc/source/ui/unoobj/shapeuno.cxx -index 151acf8..1d8a944 100644 ---- sc/source/ui/unoobj/shapeuno.cxx -+++ sc/source/ui/unoobj/shapeuno.cxx -@@ -72,6 +72,8 @@ const SfxItemPropertyMap* lcl_GetShapeMap() - {MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP), 0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 }, - {MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 }, -+ // #i66550 HLINK_FOR_SHAPES -+ {MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, - {0,0,0,0,0,0} - }; - return aShapeMap_Impl; -@@ -86,6 +88,14 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems() - }; - return aMacroDescriptionsImpl; - } -+// #i66550 HLINK_FOR_SHAPES -+ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate = FALSE ) -+{ -+ if( pShape ) -+ if( SdrObject* pObj = pShape->GetSdrObject() ) -+ return ScDrawLayer::GetMacroInfo( pObj, bCreate ); -+ return 0; -+} - - //------------------------------------------------------------------------ - -@@ -627,6 +637,13 @@ void SAL_CALL ScShapeObj::setPropertyValue( - } - } - } -+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ) -+ { -+ rtl::OUString sHlink; -+ ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, TRUE); -+ if ( ( aValue >>= sHlink ) && pInfo ) -+ pInfo->SetHlink( sHlink ); -+ } - else - { - GetShapePropertySet(); -@@ -808,6 +825,13 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa - } - } - } -+ else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ) -+ { -+ rtl::OUString sHlink; -+ if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) ) -+ sHlink = pInfo->GetHlink(); -+ aAny <<= sHlink; -+ } - else - { - GetShapePropertySet(); -@@ -1320,11 +1344,6 @@ SdrObject* ScShapeObj::GetSdrObject() const throw() - } - - #define SC_EVENTACC_ONCLICK ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ) --#ifdef ISSUE66550_HLINK_FOR_SHAPES --#define SC_EVENTACC_ONACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) ) --#define SC_EVENTACC_URL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) --#define SC_EVENTACC_ACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) ) --#endif - #define SC_EVENTACC_SCRIPT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) ) - #define SC_EVENTACC_EVENTTYPE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) ) - -@@ -1336,10 +1355,7 @@ private: - - ScMacroInfo* getInfo( BOOL bCreate = FALSE ) - { -- if( mpShape ) -- if( SdrObject* pObj = mpShape->GetSdrObject() ) -- return ScDrawLayer::GetMacroInfo( pObj, bCreate ); -- return 0; -+ return lcl_getShapeHyperMacroInfo( mpShape, bCreate ); - } - - public: -@@ -1365,11 +1381,7 @@ public: - isEventType = true; - continue; - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) ) --#else - if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) ) --#endif - { - rtl::OUString sValue; - if ( pProperties->Value >>= sValue ) -@@ -1380,10 +1392,8 @@ public: - break; - if ( pProperties->Name == SC_EVENTACC_SCRIPT ) - pInfo->SetMacro( sValue ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES - else - pInfo->SetHlink( sValue ); --#endif - } - } - } -@@ -1406,19 +1416,6 @@ public: - aProperties[ 1 ].Value <<= pInfo->GetMacro(); - } - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- else if( aName == SC_EVENTACC_ONACTION ) -- { -- if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) -- { -- aProperties.realloc( 2 ); -- aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE; -- aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION; -- aProperties[ 1 ].Name = SC_EVENTACC_URL; -- aProperties[ 1 ].Value <<= pInfo->GetHlink(); -- } -- } --#endif - else - { - throw container::NoSuchElementException(); -@@ -1429,25 +1426,14 @@ public: - - virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException) - { --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- uno::Sequence< rtl::OUString > aSeq( 2 ); --#else - uno::Sequence< rtl::OUString > aSeq( 1 ); --#endif - aSeq[ 0 ] = SC_EVENTACC_ONCLICK; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- aSeq[ 1 ] = SC_EVENTACC_ONACTION; --#endif - return aSeq; - } - - virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException) - { --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION); --#else - return aName == SC_EVENTACC_ONCLICK; --#endif - } - - // XElementAccess -diff --git sc/source/ui/view/gridwin5.cxx sc/source/ui/view/gridwin5.cxx -index 81ef0df..57797eb 100644 ---- sc/source/ui/view/gridwin5.cxx -+++ sc/source/ui/view/gridwin5.cxx -@@ -345,14 +345,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) - if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) ) - pObj = pHit; - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES - ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); - if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) - { - aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); - aHelpText = pInfo->GetHlink(); - } --#endif - } - } - } -diff --git xmloff/inc/xmloff/shapeexport.hxx xmloff/inc/xmloff/shapeexport.hxx -index bb3b369..bc331e8 100644 ---- xmloff/inc/xmloff/shapeexport.hxx -+++ xmloff/inc/xmloff/shapeexport.hxx -@@ -197,11 +197,6 @@ private: - const rtl::OUString msStartShape; - const rtl::OUString msEndShape; - const rtl::OUString msOnClick; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- const rtl::OUString msOnAction; -- const rtl::OUString msAction; -- const rtl::OUString msURL; --#endif - const rtl::OUString msEventType; - const rtl::OUString msPresentation; - const rtl::OUString msMacroName; -diff --git xmloff/source/draw/eventimp.cxx xmloff/source/draw/eventimp.cxx -index 54c0683..57c8dee 100644 ---- xmloff/source/draw/eventimp.cxx -+++ xmloff/source/draw/eventimp.cxx -@@ -104,9 +104,6 @@ public: - - sal_Bool mbValid; - sal_Bool mbScript; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- sal_Bool mbActionEvent; --#endif - ClickAction meClickAction; - XMLEffect meEffect; - XMLEffectDirection meDirection; -@@ -118,9 +115,6 @@ public: - OUString msMacroName; - OUString msBookmark; - OUString msLanguage; --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- OUString msHyperURL; --#endif - }; - - /////////////////////////////////////////////////////////////////////// -@@ -179,18 +173,11 @@ TYPEINIT1( SdXMLEventContext, SvXMLImportContext ); - - SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList, const Reference< XShape >& rxShape ) - : SvXMLImportContext(rImp, nPrfx, rLocalName), --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- mxShape( rxShape ), mbScript( sal_False ), mbActionEvent( sal_False ), meClickAction( ClickAction_NONE ), --#else - mxShape( rxShape ), mbScript( sal_False ), meClickAction( ClickAction_NONE ), --#endif - meEffect( EK_none ), meDirection( ED_none ), mnStartScale( 100 ), - meSpeed( AnimationSpeed_MEDIUM ), mnVerb(0), mbPlayFull( sal_False ) - { - static const OUString sXMLClickName( RTL_CONSTASCII_USTRINGPARAM( "click" ) ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- static const OUString sXMLActionName( RTL_CONSTASCII_USTRINGPARAM( "action" ) ); --#endif - - if( nPrfx == XML_NAMESPACE_PRESENTATION && IsXMLToken( rLocalName, XML_EVENT_LISTENER ) ) - { -@@ -261,12 +248,7 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons - sEventName = sValue; - sal_uInt16 nScriptPrefix = - GetImport().GetNamespaceMap().GetKeyByAttrName( sValue, &sEventName ); --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- mbValid = XML_NAMESPACE_DOM == nScriptPrefix && ( sEventName == sXMLClickName || sEventName == sXMLActionName ); -- mbActionEvent = mbValid && (sEventName == sXMLActionName); --#else - mbValid = XML_NAMESPACE_DOM == nScriptPrefix && sEventName == sXMLClickName; --#endif - } - else if( IsXMLToken( aAttrLocalName, XML_LANGUAGE ) ) - { -@@ -295,12 +277,6 @@ SdXMLEventContext::SdXMLEventContext( SvXMLImport& rImp, sal_uInt16 nPrfx, cons - { - msMacroName = sValue; - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- else if ( mbActionEvent ) -- { -- msHyperURL = sValue; -- } --#endif - else - { - const rtl::OUString &rTmp = -@@ -346,26 +322,6 @@ void SdXMLEventContext::EndElement() - OUString sAPIEventName; - uno::Sequence< beans::PropertyValue > aProperties; - --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if( mbActionEvent ) -- { -- sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) ); -- aProperties.realloc( 2 ); -- beans::PropertyValue* pProperty = aProperties.getArray(); -- -- pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) ); -- pProperty->Handle = -1; -- pProperty->Value <<= OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) ); -- pProperty->State = beans::PropertyState_DIRECT_VALUE; -- ++pProperty; -- pProperty->Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ); -- pProperty->Handle = -1; -- pProperty->Value <<= msHyperURL; -- pProperty->State = beans::PropertyState_DIRECT_VALUE; -- } -- else --#endif -- { - sAPIEventName = OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ); - - if( mbScript ) -@@ -550,8 +506,6 @@ void SdXMLEventContext::EndElement() - break; - } - } -- } -- - xEvents->replaceByName( sAPIEventName, uno::Any( aProperties ) ); - - } while(0); -diff --git xmloff/source/draw/shapeexport.cxx xmloff/source/draw/shapeexport.cxx -index 4691d72..0bfa0cb 100644 ---- xmloff/source/draw/shapeexport.cxx -+++ xmloff/source/draw/shapeexport.cxx -@@ -87,11 +87,6 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, - msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ), - msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ), - msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ), --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- msOnAction( RTL_CONSTASCII_USTRINGPARAM("OnAction") ), -- msAction( RTL_CONSTASCII_USTRINGPARAM("Action") ), -- msURL( RTL_CONSTASCII_USTRINGPARAM("URL") ), --#endif - msEventType( RTL_CONSTASCII_USTRINGPARAM("EventType") ), - msPresentation( RTL_CONSTASCII_USTRINGPARAM("Presentation") ), - msMacroName( RTL_CONSTASCII_USTRINGPARAM("MacroName") ), -diff --git xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport2.cxx -index c3594a6..d7005be 100644 ---- xmloff/source/draw/shapeexport2.cxx -+++ xmloff/source/draw/shapeexport2.cxx -@@ -296,9 +296,6 @@ const sal_Int32 FOUND_CLICKEVENTTYPE = 0x00000080; - const sal_Int32 FOUND_MACRO = 0x00000100; - const sal_Int32 FOUND_LIBRARY = 0x00000200; - const sal_Int32 FOUND_ACTIONEVENTTYPE = 0x00000400; --#ifdef ISSUE66550_HLINK_FOR_SHAPES --const sal_Int32 FOUND_URL = 0x00000800; --#endif - - } // namespace - -@@ -388,33 +385,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x - } - } - --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- // extract properties from "OnAction" event ------------------------------- -- -- OUString aActionEventType; -- OUString aHyperURL; -- -- uno::Sequence< beans::PropertyValue > aActionProperties; -- if( xEvents->hasByName( msOnAction ) && (xEvents->getByName( msOnAction ) >>= aActionProperties) ) -- { -- const beans::PropertyValue* pProperty = aActionProperties.getConstArray(); -- const beans::PropertyValue* pPropertyEnd = pProperty + aActionProperties.getLength(); -- for( ; pProperty != pPropertyEnd; ++pProperty ) -- { -- if( ( ( nFound & FOUND_ACTIONEVENTTYPE ) == 0 ) && pProperty->Name == msEventType ) -- { -- if( pProperty->Value >>= aActionEventType ) -- nFound |= FOUND_ACTIONEVENTTYPE; -- } -- else if( ( ( nFound & FOUND_URL ) == 0 ) && ( pProperty->Name == msURL ) ) -- { -- if( pProperty->Value >>= aHyperURL ) -- nFound |= FOUND_URL; -- } -- } -- } --#endif -- - // create the XML elements - - if( aClickEventType == msPresentation ) -@@ -566,15 +536,9 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x - SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True); - } - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- else if( aClickEventType == msScript || aActionEventType == msAction ) -- { -- if( nFound & ( FOUND_MACRO | FOUND_URL ) ) --#else - else if( aClickEventType == msScript ) - { - if( nFound & FOUND_MACRO ) --#endif - { - SvXMLElementExport aEventsElemt(mrExport, XML_NAMESPACE_OFFICE, XML_EVENT_LISTENERS, sal_True, sal_True); - if ( nFound & FOUND_MACRO ) -@@ -589,18 +553,6 @@ void XMLShapeExport::ImpExportEvents( const uno::Reference< drawing::XShape >& x - - SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_SCRIPT, XML_EVENT_LISTENER, sal_True, sal_True); - } --#ifdef ISSUE66550_HLINK_FOR_SHAPES -- if ( nFound & FOUND_URL ) -- { -- OUString aEventQName( -- mrExport.GetNamespaceMap().GetQNameByKey( -- XML_NAMESPACE_DOM, OUString( RTL_CONSTASCII_USTRINGPARAM( "action" ) ) ) ); -- mrExport.AddAttribute( XML_NAMESPACE_SCRIPT, XML_EVENT_NAME, aEventQName ); -- mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aHyperURL ); -- -- SvXMLElementExport aEventElemt(mrExport, XML_NAMESPACE_PRESENTATION, XML_EVENT_LISTENER, sal_True, sal_True); -- } --#endif - } - } - } -diff --git xmloff/source/draw/ximpshap.cxx xmloff/source/draw/ximpshap.cxx -index 5d1d0da..c461d59 100644 ---- xmloff/source/draw/ximpshap.cxx -+++ xmloff/source/draw/ximpshap.cxx -@@ -375,6 +375,11 @@ void SdXMLShapeContext::EndElement() - - if( msHyperlink.getLength() != 0 ) try - { -+ uno::Reference< beans::XPropertySet > xProp( mxShape, uno::UNO_QUERY ); -+ -+ rtl::OUString sLink( RTL_CONSTASCII_USTRINGPARAM( "Hyperlink" ) ); -+ if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName( sLink ) ) -+ xProp->setPropertyValue( sLink, uno::Any( msHyperlink ) ); - Reference< XEventsSupplier > xEventsSupplier( mxShape, UNO_QUERY_THROW ); - Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_QUERY_THROW ); - -@@ -3230,9 +3235,16 @@ SvXMLImportContext *SdXMLFrameShapeContext::CreateChildContext( USHORT nPrefix, - - if( !mxImplContext.Is() ) - { -- pContext = GetImport().GetShapeImport()->CreateFrameChildContext( -+ -+ SvXMLShapeContext* pShapeContext= GetImport().GetShapeImport()->CreateFrameChildContext( - GetImport(), nPrefix, rLocalName, xAttrList, mxShapes, mxAttrList ); - -+ pContext = pShapeContext; -+ -+ // propagate the hyperlink to child context -+ if ( msHyperlink.getLength() > 0 ) -+ pShapeContext->setHyperlink( msHyperlink ); -+ - mxImplContext = pContext; - mbSupportsReplacement = IsXMLToken( rLocalName, XML_OBJECT ) || - IsXMLToken( rLocalName, XML_OBJECT_OLE ); |