diff options
-rw-r--r-- | include/editeng/urlfieldhelper.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 3 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsf.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtex.cxx | 2 |
6 files changed, 11 insertions, 6 deletions
diff --git a/include/editeng/urlfieldhelper.hxx b/include/editeng/urlfieldhelper.hxx index e6c7c92935a4..9a1d53d15512 100644 --- a/include/editeng/urlfieldhelper.hxx +++ b/include/editeng/urlfieldhelper.hxx @@ -19,6 +19,10 @@ class EDITENG_DLLPUBLIC URLFieldHelper public: static void RemoveURLField(EditView& pEditView); static bool IsCursorAtURLField(const EditView& pEditView); + static bool IsCursorAtURLField(const OutlinerView* pOLV) + { + return pOLV && IsCursorAtURLField(pOLV->GetEditView()); + } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index f3bd9f7cb9cf..592ab19aea31 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -411,7 +411,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) || rSet.GetItemState(SID_REMOVE_HYPERLINK) != SfxItemState::UNKNOWN) { SdrView* pView = pViewData->GetScDrawView(); - if( !URLFieldHelper::IsCursorAtURLField(pView->GetTextEditOutlinerView()->GetEditView()) ) + if( !URLFieldHelper::IsCursorAtURLField(pView->GetTextEditOutlinerView()) ) { rSet.DisableItem( SID_OPEN_HYPERLINK ); rSet.DisableItem( SID_EDIT_HYPERLINK ); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 3097f9496542..6970fe0aeb28 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1205,8 +1205,10 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) // First make sure the field is selected OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView(); if (pOutView) + { pOutView->SelectFieldAtCursor(); - URLFieldHelper::RemoveURLField(pOutView->GetEditView()); + URLFieldHelper::RemoveURLField(pOutView->GetEditView()); + } } } Cancel(); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 0874a587a3a1..7fd0ce58368e 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1449,8 +1449,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) { if( mpDrawView->IsTextEdit() ) { - OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView(); - if (pOLV && URLFieldHelper::IsCursorAtURLField(pOLV->GetEditView())) + if (URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView())) bDisableEditHyperlink = false; } else diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 906f4b331e90..95ecd4a0d52a 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -511,7 +511,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_REMOVE_HYPERLINK: { - if (!URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()->GetEditView())) + if (!URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView())) rSet.DisableItem(nWhich); } break; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 4f67f27449d9..c63f96eb563c 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -978,7 +978,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) case SID_OPEN_HYPERLINK: case SID_COPY_HYPERLINK_LOCATION: { - if (!URLFieldHelper::IsCursorAtURLField(pOLV->GetEditView())) + if (!URLFieldHelper::IsCursorAtURLField(pOLV)) rSet.DisableItem(nWhich); } break; |