summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2002-11-26 07:45:42 +0000
committerDaniel Rentz <dr@openoffice.org>2002-11-26 07:45:42 +0000
commit62045b7198b8760257e40172061e1dc2f15ac104 (patch)
treeaf4f59ffb95beb674171ddb0bffb1fbdccb80eb9 /sc/source
parentfbf68271052d9693facedb8685340696e55a0da0 (diff)
#105412# new popup menu entry 'Open Hyperlink'
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx42
-rw-r--r--sc/source/ui/drawfunc/objdraw.src27
-rw-r--r--sc/source/ui/src/popup.src11
-rw-r--r--sc/source/ui/view/editsh.cxx20
4 files changed, 74 insertions, 26 deletions
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index f0b171c50914..ad72d2a78d20 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: drtxtob.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: nn $ $Date: 2002-09-12 18:07:11 $
+ * last change: $Author: dr $ $Date: 2002-11-26 08:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -318,6 +318,26 @@ void __EXPORT ScDrawTextObjectBar::Execute( SfxRequest &rReq )
}
break;
+ case SID_OPEN_HYPERLINK:
+ {
+ SdrView* pView = pViewData->GetScDrawView();
+ OutlinerView* pOutView = pView->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 );
+ ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
+ }
+ }
+ }
+ }
+ break;
+
case SID_ENABLE_HYPHENATION:
case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
@@ -394,6 +414,24 @@ void __EXPORT ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
rSet.Put(aHLinkItem);
}
+ if ( rSet.GetItemState( SID_OPEN_HYPERLINK ) != SFX_ITEM_UNKNOWN )
+ {
+ SdrView* pView = pViewData->GetScDrawView();
+ OutlinerView* pOutView = pView->GetTextEditOutlinerView();
+ bool bEnable = false;
+ if ( pOutView )
+ {
+ const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
+ if ( pFieldItem )
+ {
+ const SvxFieldData* pField = pFieldItem->GetField();
+ bEnable = pField && pField->ISA( SvxURLField );
+ }
+ }
+ if( !bEnable )
+ rSet.DisableItem( SID_OPEN_HYPERLINK );
+ }
+
if ( rSet.GetItemState( SID_TRANSLITERATE_HALFWIDTH ) != SFX_ITEM_UNKNOWN ||
rSet.GetItemState( SID_TRANSLITERATE_FULLWIDTH ) != SFX_ITEM_UNKNOWN ||
rSet.GetItemState( SID_TRANSLITERATE_HIRAGANA ) != SFX_ITEM_UNKNOWN ||
diff --git a/sc/source/ui/drawfunc/objdraw.src b/sc/source/ui/drawfunc/objdraw.src
index f7fa65c1d0fa..4d84ddd1d77a 100644
--- a/sc/source/ui/drawfunc/objdraw.src
+++ b/sc/source/ui/drawfunc/objdraw.src
@@ -2,9 +2,9 @@
*
* $RCSfile: objdraw.src,v $
*
- * $Revision: 1.51 $
+ * $Revision: 1.52 $
*
- * last change: $Author: kz $ $Date: 2002-11-04 17:22:17 $
+ * last change: $Author: dr $ $Date: 2002-11-26 08:44:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1821,24 +1821,11 @@ Menu RID_POPUP_DRAWTEXT
MenuItem { Separator = TRUE ; };
// Zeichen, Absatz
MN_DRWTXT
+ MenuItem { Separator = TRUE ; };
+ MenuItem
+ {
+ ITEM_OPEN_HYPERLINK
+ };
};
};
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/sc/source/ui/src/popup.src b/sc/source/ui/src/popup.src
index f3708b11cf47..dadd2cef322b 100644
--- a/sc/source/ui/src/popup.src
+++ b/sc/source/ui/src/popup.src
@@ -2,9 +2,9 @@
*
* $RCSfile: popup.src,v $
*
- * $Revision: 1.40 $
+ * $Revision: 1.41 $
*
- * last change: $Author: kz $ $Date: 2002-11-04 17:29:47 $
+ * last change: $Author: dr $ $Date: 2002-11-26 08:45:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1210,6 +1210,13 @@ Menu RID_POPUP_EDIT
{
ITEM_FORMAT_CHAR_DLG
};
+ //------------------------------
+ MenuItem { Separator = TRUE ; };
+ //------------------------------
+ MenuItem
+ {
+ ITEM_OPEN_HYPERLINK
+ };
};
};
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 13134f82713f..9d56ba8bc1d6 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: editsh.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: nn $ $Date: 2002-11-12 16:09:23 $
+ * last change: $Author: dr $ $Date: 2002-11-26 08:45:42 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -528,6 +528,15 @@ void ScEditShell::Execute( SfxRequest& rReq )
}
}
break;
+
+ case SID_OPEN_HYPERLINK:
+ {
+ const SvxURLField* pURLField = GetURLField();
+ if ( pURLField )
+ ScGlobal::OpenURL( pURLField->GetURL(), pURLField->GetTargetFrame() );
+ return;
+ }
+ break;
}
pHdl->DataChanged();
@@ -577,6 +586,13 @@ void __EXPORT ScEditShell::GetState( SfxItemSet& rSet )
}
break;
+ case SID_OPEN_HYPERLINK:
+ {
+ if ( !GetURLField() )
+ rSet.DisableItem( nWhich );
+ }
+ break;
+
case SID_TRANSLITERATE_HALFWIDTH:
case SID_TRANSLITERATE_FULLWIDTH:
case SID_TRANSLITERATE_HIRAGANA: