[Libreoffice-commits] core.git: 2 commits - sd/source sw/uiconfig
Samuel Mehrbrodt (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 6 14:44:09 UTC 2019
sd/source/ui/view/drviews2.cxx | 49 ++++++++++++++--------------
sw/uiconfig/sglobal/popupmenu/drawtext.xml | 5 ++
sw/uiconfig/swform/popupmenu/drawtext.xml | 5 ++
sw/uiconfig/swreport/popupmenu/drawtext.xml | 5 ++
sw/uiconfig/swxform/popupmenu/drawtext.xml | 5 ++
5 files changed, 45 insertions(+), 24 deletions(-)
New commits:
commit fe44699a244a91f28e8fc43278fff67bf1db7c9c
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Aug 6 15:14:00 2019 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Aug 6 16:43:15 2019 +0200
Select hyperlink before editing in sd
Otherwise you can't edit a hyperlink when the cursor is behind the field.
Change-Id: Iea937e16d5be1187f78cbaa565698232cb10dc64
Reviewed-on: https://gerrit.libreoffice.org/77028
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 036862ed0229..ed6ca12113e3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2116,6 +2116,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_EDIT_HYPERLINK :
{
+ // Ensure the field is selected first
+ OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
+ if (pOutView)
+ pOutView->GetFieldAtCursor();
+
GetViewFrame()->GetDispatcher()->Execute( SID_HYPERLINK_DIALOG );
Cancel();
@@ -2128,35 +2133,31 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
OutlinerView* pOutView = mpDrawView->GetTextEditOutlinerView();
if ( pOutView )
{
- const SvxFieldItem* pFieldItem = pOutView->GetFieldAtSelection();
- if ( pFieldItem )
+ const SvxFieldData* pField = pOutView->GetFieldAtCursor();
+ if( auto pURLField = dynamic_cast< const SvxURLField *>( pField ) )
{
- const SvxFieldData* pField = pFieldItem->GetField();
- if( auto pURLField = dynamic_cast< const SvxURLField *>( pField ) )
- {
- SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() );
- SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() );
+ SfxStringItem aUrl( SID_FILE_NAME, pURLField->GetURL() );
+ SfxStringItem aTarget( SID_TARGETNAME, pURLField->GetTargetFrame() );
- OUString aReferName;
- SfxViewFrame* pFrame = GetViewFrame();
- SfxMedium* pMed = pFrame->GetObjectShell()->GetMedium();
- if (pMed)
- aReferName = pMed->GetName();
+ OUString aReferName;
+ SfxViewFrame* pFrame = GetViewFrame();
+ SfxMedium* pMed = pFrame->GetObjectShell()->GetMedium();
+ if (pMed)
+ aReferName = pMed->GetName();
- SfxFrameItem aFrm( SID_DOCFRAME, pFrame );
- SfxStringItem aReferer( SID_REFERER, aReferName );
+ SfxFrameItem aFrm( SID_DOCFRAME, pFrame );
+ SfxStringItem aReferer( SID_REFERER, aReferName );
- SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
- SfxBoolItem aBrowsing( SID_BROWSE, true );
+ SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
+ SfxBoolItem aBrowsing( SID_BROWSE, true );
- SfxViewFrame* pViewFrm = SfxViewFrame::Current();
- if (pViewFrm)
- {
- pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
- SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
- { &aUrl, &aTarget, &aFrm, &aReferer,
- &aNewView, &aBrowsing });
- }
+ SfxViewFrame* pViewFrm = SfxViewFrame::Current();
+ if (pViewFrm)
+ {
+ pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
+ SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
+ { &aUrl, &aTarget, &aFrm, &aReferer,
+ &aNewView, &aBrowsing });
}
}
}
commit 10ad2985c1a68cb5ef7f64707ed69441c0c013c4
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Aug 6 15:13:38 2019 +0200
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Aug 6 16:43:09 2019 +0200
Add missing hyperlink context menu entries to sw
Change-Id: Iba2346ca635c2e4168d56d8c01e43a8495c4ed98
Reviewed-on: https://gerrit.libreoffice.org/77027
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/sw/uiconfig/sglobal/popupmenu/drawtext.xml b/sw/uiconfig/sglobal/popupmenu/drawtext.xml
index e13990ca0af9..07a09cccae9d 100644
--- a/sw/uiconfig/sglobal/popupmenu/drawtext.xml
+++ b/sw/uiconfig/sglobal/popupmenu/drawtext.xml
@@ -25,5 +25,10 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
<menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+ <menu:menuitem menu:id=".uno:EditHyperlink"/>
+ <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+ <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:ResetAttributes"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swform/popupmenu/drawtext.xml b/sw/uiconfig/swform/popupmenu/drawtext.xml
index e13990ca0af9..07a09cccae9d 100644
--- a/sw/uiconfig/swform/popupmenu/drawtext.xml
+++ b/sw/uiconfig/swform/popupmenu/drawtext.xml
@@ -25,5 +25,10 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
<menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+ <menu:menuitem menu:id=".uno:EditHyperlink"/>
+ <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+ <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:ResetAttributes"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swreport/popupmenu/drawtext.xml b/sw/uiconfig/swreport/popupmenu/drawtext.xml
index e13990ca0af9..07a09cccae9d 100644
--- a/sw/uiconfig/swreport/popupmenu/drawtext.xml
+++ b/sw/uiconfig/swreport/popupmenu/drawtext.xml
@@ -25,5 +25,10 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
<menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+ <menu:menuitem menu:id=".uno:EditHyperlink"/>
+ <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+ <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:ResetAttributes"/>
</menu:menupopup>
diff --git a/sw/uiconfig/swxform/popupmenu/drawtext.xml b/sw/uiconfig/swxform/popupmenu/drawtext.xml
index e13990ca0af9..07a09cccae9d 100644
--- a/sw/uiconfig/swxform/popupmenu/drawtext.xml
+++ b/sw/uiconfig/swxform/popupmenu/drawtext.xml
@@ -25,5 +25,10 @@
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
<menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+ <menu:menuitem menu:id=".uno:EditHyperlink"/>
+ <menu:menuitem menu:id=".uno:CopyHyperlinkLocation"/>
+ <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
+ <menu:menuseparator/>
<menu:menuitem menu:id=".uno:ResetAttributes"/>
</menu:menupopup>
More information about the Libreoffice-commits
mailing list