#105412# added SID_OPEN_HYPERLINK

This commit is contained in:
Christian Lippka 2002-11-26 14:32:36 +00:00
parent 61ae129e23
commit c8b2e35b47
3 changed files with 58 additions and 6 deletions

View file

@ -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 ;

View file

@ -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() )
{

View file

@ -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();