[Libreoffice-commits] core.git: sd/source

Vasily Melenchuk Vasily.Melenchuk at cib.de
Fri Apr 13 14:55:30 UTC 2018


 sd/source/ui/func/fudraw.cxx |   59 +++++++++++++++++++++----------------------
 1 file changed, 29 insertions(+), 30 deletions(-)

New commits:
commit c7272eea116350e1424d59c358d8528016a2f713
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Thu Apr 12 18:06:54 2018 +0300

    sd: hyperlink hint was not always shown
    
    Change-Id: Ic885688ce0f757c3230a5e355a4eef8da71dbda1
    Reviewed-on: https://gerrit.libreoffice.org/52785
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx
index cfc73674c678..76d3edf027a3 100644
--- a/sd/source/ui/func/fudraw.cxx
+++ b/sd/source/ui/func/fudraw.cxx
@@ -791,6 +791,35 @@ bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewE
             }
         }
     }
+    else if (rVEvt.pURLField)
+    {
+        /**************************************************************
+        * URL-Field
+        **************************************************************/
+        OUString aURL = INetURLObject::decode(rVEvt.pURLField->GetURL(), INetURLObject::DecodeMechanism::WithCharset);
+
+        SvtSecurityOptions aSecOpt;
+        if (aSecOpt.IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink))
+        {
+            // Hint about Ctrl-click to open hyperlink, but need to detect "Ctrl" key for MacOs
+            vcl::KeyCode aCode(KEY_SPACE);
+            vcl::KeyCode aModifiedCode(KEY_SPACE, KEY_MOD1);
+            OUString aModStr(aModifiedCode.GetName());
+            aModStr = aModStr.replaceFirst(aCode.GetName(), "");
+            aModStr = aModStr.replaceAll("+", "");
+
+            OUString aCtrlClickHlinkStr = SdResId(STR_CTRLCLICKHYPERLINK);
+
+            aCtrlClickHlinkStr = aCtrlClickHlinkStr.replaceAll("%s", aModStr);
+
+            aHelpText = aCtrlClickHlinkStr + aURL;
+        }
+        else
+        {
+            // Hint about just clicking hyperlink
+            aHelpText = SdResId(STR_CLICKHYPERLINK) + aURL;
+        }
+    }
     else if (dynamic_cast< GraphicDocShell *>( mpDocSh ) ==  nullptr && SdDrawDocument::GetAnimationInfo(pObj))
     {
         SdAnimationInfo* pInfo = SdDrawDocument::GetAnimationInfo(pObj);
@@ -898,36 +927,6 @@ bool FuDraw::SetHelpText(SdrObject* pObj, const Point& rPosPixel, const SdrViewE
                 break;
         }
     }
-    else if (rVEvt.pURLField)
-    {
-        /**************************************************************
-        * URL-Field
-        **************************************************************/
-        OUString aURL = INetURLObject::decode( rVEvt.pURLField->GetURL(), INetURLObject::DecodeMechanism::WithCharset );
-
-        SvtSecurityOptions aSecOpt;
-        if (aSecOpt.IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink))
-        {
-            // Hint about Ctrl-click to open hyperlink
-            // But need to detect "Ctrl" key for MacOs
-            vcl::KeyCode aCode(KEY_SPACE);
-            vcl::KeyCode aModifiedCode(KEY_SPACE, KEY_MOD1);
-            OUString aModStr(aModifiedCode.GetName());
-            aModStr = aModStr.replaceFirst(aCode.GetName(), "");
-            aModStr = aModStr.replaceAll("+", "");
-
-            OUString aCtrlClickHlinkStr = SdResId(STR_CTRLCLICKHYPERLINK);
-
-            aCtrlClickHlinkStr = aCtrlClickHlinkStr.replaceAll("%s", aModStr);
-
-            aHelpText = aCtrlClickHlinkStr + aURL;
-        }
-        else
-        {
-            // Hint about just clicking hyperlink
-            aHelpText = SdResId(STR_CLICKHYPERLINK) + aURL;
-        }
-    }
 
     if (!aHelpText.isEmpty())
     {


More information about the Libreoffice-commits mailing list