summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2002-11-26 14:32:36 +0000
committerChristian Lippka <cl@openoffice.org>2002-11-26 14:32:36 +0000
commitc8b2e35b4729f032fc8c53006d9e0a053c54d3ea (patch)
treeaf662677dc1a77c7be1834fafa33b378f3745bd5 /sd/source
parent61ae129e2340161a73d4a073adb9f6c1c2eb18ca (diff)
#105412# added SID_OPEN_HYPERLINK
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/view/drviews7.cxx7
-rw-r--r--sd/source/ui/view/drviewsb.cxx48
2 files changed, 51 insertions, 4 deletions
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();