[Libreoffice-commits] core.git: include/svx officecfg/registry sd/sdi sd/source sd/uiconfig svx/sdi

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 18 14:23:17 UTC 2019


 include/svx/svxids.hrc                                               |    1 
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |    8 +++
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu  |    8 ---
 sd/sdi/_drvwsh.sdi                                                   |    5 ++
 sd/source/ui/view/drviews2.cxx                                       |   15 ++++---
 sd/source/ui/view/drviewsf.cxx                                       |   21 ++++++++++
 sd/uiconfig/simpress/popupmenu/drawtext.xml                          |    1 
 svx/sdi/svx.sdi                                                      |   17 ++++++++
 8 files changed, 63 insertions(+), 13 deletions(-)

New commits:
commit 533dec5a3ddaff7ec176609edcff2cde4464747a
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Jun 18 13:43:27 2019 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Jun 18 16:21:32 2019 +0200

    tdf#111707 Add 'Remove Hyperlink' to context menu in Impress
    
    "Clear formatting" no longer removes the hyperlink,
    as now there is a dedicated context menu entry for this.
    
    Change-Id: Ic47795b9ecb238470f853da527c648f6edb94c09
    Reviewed-on: https://gerrit.libreoffice.org/74272
    Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index b5cbbab79d47..bec13fcf907a 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -497,6 +497,7 @@ class SvxSetItem;
 #define SID_GROUP                                       ( SID_SVX_START + 454 )
 #define SID_UNGROUP                                     ( SID_SVX_START + 455 )
 #define SID_SET_DEFAULT                                 ( SID_SVX_START + 456 )
+#define SID_REMOVE_HYPERLINK                            ( SID_SVX_START + 457 )
 
 // CAUTION! Range <457 .. 457> used by EditEngine (!)
 
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 840c17d5404f..f8a45ed58929 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -7013,6 +7013,14 @@
           <value xml:lang="en-US">Regenerate Diagram</value>
         </prop>
       </node>
+      <node oor:name=".uno:RemoveHyperlink" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">~Remove Hyperlink</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
     </node>
   </node>
 </oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 568a093e3ea4..df8fb4f821b2 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -457,14 +457,6 @@
           <value>1</value>
         </prop>
       </node>
-      <node oor:name=".uno:RemoveHyperlink" oor:op="replace">
-        <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Remove Hyperlink</value>
-        </prop>
-        <prop oor:name="Properties" oor:type="xs:int">
-          <value>1</value>
-        </prop>
-      </node>
       <node oor:name=".uno:CopyHyperlinkLocation" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Copy Hyperlink Location</value>
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 93a30e6757dc..8dfdf71023de 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -1522,6 +1522,11 @@ interface DrawView
         ExecMethod = FuTemporary ;
         StateMethod = GetAttrState ;
     ]
+    SID_REMOVE_HYPERLINK // ole : no, status : ?
+    [
+        ExecMethod = FuTemporary ;
+        StateMethod = GetAttrState ;
+    ]
     SID_RULER_PAGE_POS // ole : no, status : ?
     [
         ExecMethod = ExecRuler ;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 007f3723b882..b6933d934182 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1145,18 +1145,24 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         rReq.Done ();
         break;
 
-        case SID_SET_DEFAULT:
+        case SID_REMOVE_HYPERLINK:
         {
-            std::unique_ptr<SfxItemSet> pSet;
-
             if (mpDrawView->IsTextEdit())
             {
-                ::Outliner* pOutl = mpDrawView->GetTextEditOutliner();
+                Outliner* pOutl = mpDrawView->GetTextEditOutliner();
                 if (pOutl)
                 {
                     pOutl->RemoveFields(checkSvxFieldData<SvxURLField>);
                 }
+            }
+        }
+        break;
+        case SID_SET_DEFAULT:
+        {
+            std::unique_ptr<SfxItemSet> pSet;
 
+            if (mpDrawView->IsTextEdit())
+            {
                 pSet.reset(new SfxItemSet( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} ));
                 mpDrawView->SetAttributes( *pSet, true );
             }
@@ -1213,7 +1219,6 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                                 if( nLevel == 1 )
                                     // text frame listens on StyleSheet of level1
                                     pObj->NbcSetStyleSheet(pSheet, false);
-
                             }
                         }
                     }
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 7c48e20a95d8..0d5081cbfd17 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -482,6 +482,27 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
             }
             break;
 
+            case SID_REMOVE_HYPERLINK:
+            {
+                OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
+                if (pOLV)
+                {
+                    bool bField = false;
+                    const SvxFieldItem* pFieldItem = pOLV->GetFieldUnderMousePointer();
+                    if (!pFieldItem)
+                        pFieldItem = pOLV->GetFieldAtSelection();
+                    if (pFieldItem)
+                    {
+                        const SvxFieldData* pField = pFieldItem->GetField();
+                        if (dynamic_cast<const SvxURLField*>(pField))
+                            bField = true;
+                    }
+                    if (!bField)
+                        rSet.DisableItem(nWhich);
+                }
+            }
+            break;
+
             case SID_STYLE_WATERCAN:
             {
                 std::unique_ptr<SfxPoolItem> pItem;
diff --git a/sd/uiconfig/simpress/popupmenu/drawtext.xml b/sd/uiconfig/simpress/popupmenu/drawtext.xml
index a8567fe4d272..23281741dd87 100644
--- a/sd/uiconfig/simpress/popupmenu/drawtext.xml
+++ b/sd/uiconfig/simpress/popupmenu/drawtext.xml
@@ -19,6 +19,7 @@
   <menu:menuitem menu:id=".uno:OutlineBullet"/>
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:OpenHyperlinkOnCursor"/>
+  <menu:menuitem menu:id=".uno:RemoveHyperlink"/>
   <menu:menuitem menu:id=".uno:ThesaurusFromContext"/>
   <menu:menuseparator/>
   <menu:menuitem menu:id=".uno:SetDefault"/>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 00f4d7c9bca5..6e9b07be15dc 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12047,3 +12047,20 @@ SfxVoidItem SignSignatureLine SID_SIGN_SIGNATURELINE
     ToolBoxConfig = FALSE,
     GroupId = SfxGroupId::Edit;
 ]
+
+SfxVoidItem RemoveHyperlink SID_REMOVE_HYPERLINK
+()
+[
+    AutoUpdate = FALSE,
+    FastCall = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerSet;
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = SfxGroupId::Edit;
+]
\ No newline at end of file


More information about the Libreoffice-commits mailing list