diff options
author | Daniel Rentz <dr@openoffice.org> | 2002-11-26 07:45:42 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2002-11-26 07:45:42 +0000 |
commit | 62045b7198b8760257e40172061e1dc2f15ac104 (patch) | |
tree | af4f59ffb95beb674171ddb0bffb1fbdccb80eb9 /sc/source/ui/drawfunc/drtxtob.cxx | |
parent | fbf68271052d9693facedb8685340696e55a0da0 (diff) |
#105412# new popup menu entry 'Open Hyperlink'
Diffstat (limited to 'sc/source/ui/drawfunc/drtxtob.cxx')
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 42 |
1 files changed, 40 insertions, 2 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 || |