From c8b2e35b4729f032fc8c53006d9e0a053c54d3ea Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Tue, 26 Nov 2002 14:32:36 +0000 Subject: [PATCH] #105412# added SID_OPEN_HYPERLINK --- sd/sdi/_drvwsh.sdi | 9 +++++-- sd/source/ui/view/drviews7.cxx | 7 +++-- sd/source/ui/view/drviewsb.cxx | 48 ++++++++++++++++++++++++++++++++-- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index bc89f7e59e98..9f54e74e7d1a 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2,9 +2,9 @@ * * $RCSfile: _drvwsh.sdi,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: bm $ $Date: 2002-11-04 17:25:24 $ + * last change: $Author: cl $ $Date: 2002-11-26 15:29:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2142,6 +2142,11 @@ interface DrawView : View ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] + SID_OPEN_HYPERLINK // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] SID_TRANSLITERATE_UPPER // ole : no, status : ? [ ExecMethod = FuSupport ; diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 10d0d76c0025..80e683d5a4b2 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drviews7.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: af $ $Date: 2002-11-19 15:49:43 $ + * last change: $Author: cl $ $Date: 2002-11-26 15:32:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1557,6 +1557,9 @@ void SdDrawViewShell::GetMenuState( SfxItemSet &rSet ) if ( bDisableEditHyperlink || pDocSh->IsReadOnly() ) rSet.DisableItem( SID_EDIT_HYPERLINK ); + if ( bDisableEditHyperlink ) + rSet.DisableItem( SID_OPEN_HYPERLINK ); + #if defined WIN || defined WNT || defined UNX if( Application::IsRemoteServer() || !mxScannerManager.is() ) { diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index b91fd501c9a0..097cf637903a 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -2,9 +2,9 @@ * * $RCSfile: drviewsb.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: bm $ $Date: 2002-11-04 17:42:49 $ + * last change: $Author: cl $ $Date: 2002-11-26 15:31:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -442,6 +442,50 @@ void SdDrawViewShell::FuTemp02(SfxRequest& rReq) } break; + case SID_OPEN_HYPERLINK: + { + OutlinerView* pOutView = pDrView->GetTextEditOutlinerView(); + if ( pOutView ) + { + const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection(); + if ( pFieldItem ) + { + const SvxFieldData* pField = pFieldItem->GetField(); + if( pField && pField->ISA( SvxURLField ) ) + { + const SvxURLField* pURLField = static_cast< const SvxURLField* >( pField ); + + SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() ); + SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() ); + + String aReferName; + SfxViewFrame* pFrame = GetViewFrame(); + SfxMedium* pMed = pFrame->GetObjectShell()->GetMedium(); + if (pMed) + aReferName = pMed->GetName(); + + SfxFrameItem aFrm( SID_DOCFRAME, pFrame ); + SfxStringItem aReferer( SID_REFERER, aReferName ); + + SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, FALSE ); + SfxBoolItem aBrowsing( SID_BROWSE, TRUE ); + + SfxViewFrame* pViewFrm = SfxViewFrame::Current(); + if (pViewFrm) + pViewFrm->GetDispatcher()->Execute( SID_OPENDOC, + SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, + &aUrl, &aTarget, + &aFrm, &aReferer, + &aNewView, &aBrowsing, + 0L ); + } + } + } + Cancel(); + rReq.Done (); + } + break; + case SID_HYPERLINK_SETLINK: { const SfxItemSet* pReqArgs = rReq.GetArgs();