diff options
-rw-r--r-- | sc/sdi/drtxtob.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/editsh.sdi | 1 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 42 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/objdraw.src | 27 | ||||
-rw-r--r-- | sc/source/ui/src/popup.src | 11 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 20 |
6 files changed, 76 insertions, 26 deletions
diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi index 176233ed1879..d1d6959b32db 100644 --- a/sc/sdi/drtxtob.sdi +++ b/sc/sdi/drtxtob.sdi @@ -83,6 +83,7 @@ interface TableDrawText : Selection SID_HYPERLINK_SETLINK [ ExecMethod = Execute; Export = FALSE; ] SID_HYPERLINK_GETLINK [ StateMethod = GetState; Export = FALSE; ] + SID_OPEN_HYPERLINK [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] SID_ENABLE_HYPHENATION [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] SID_TEXTDIRECTION_LEFT_TO_RIGHT [ ExecMethod = Execute; StateMethod = GetAttrState; Export = FALSE; ] diff --git a/sc/sdi/editsh.sdi b/sc/sdi/editsh.sdi index 17ca37abbff7..b2d1f5e8bd48 100644 --- a/sc/sdi/editsh.sdi +++ b/sc/sdi/editsh.sdi @@ -51,6 +51,7 @@ interface TableText : Selection SID_HYPERLINK_SETLINK [ ExecMethod = Execute; Export = FALSE; ] SID_HYPERLINK_GETLINK [ StateMethod = GetState; Export = FALSE; ] + SID_OPEN_HYPERLINK [ ExecMethod = Execute; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_UPPER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] SID_TRANSLITERATE_LOWER [ ExecMethod = ExecuteTrans; StateMethod = GetState; Export = FALSE; ] 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: |