desktop/source/lib/init.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 06bed3046b4ca62a50566f42d3a7079f0b563935
Author:     Mert Tumer <mert.tu...@collabora.com>
AuthorDate: Mon Aug 17 11:40:38 2020 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Aug 18 22:29:25 2020 +0200

    Fix hyperlink popup does not show up
    
    The popup does not show up when double clicking
    same cell after first one when the cell has a
    hyperlink. This is because LOK_CALLBACK_INVALIDATE
    _VISIBLE_CURSOR message is filtered out when it
    is duplicate and hyperlink is inside this callback.
    
    Selecting different cell after editing one does not
    make calc to send another invalidate cursor message
    because it is only sent if the selected cell is being
    edited. This confuses the ui experience, so this patch
    prevents the callback from being filtered out
    if only it contains a hyperlink. If there is not a hyperlink
    on the cursor position the duplicate callbacks will still
    be filtered out.
    
    Signed-off-by: Mert Tumer <mert.tu...@collabora.com>
    Change-Id: Ibca0887b7d49633e476bc63d08bc0b7cc309d710
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100851
    Tested-by: Jenkins
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 78f152166acd..beb35b4e5fcc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1546,10 +1546,15 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
             case LOK_CALLBACK_CALC_FUNCTION_LIST:
             case LOK_CALLBACK_JSDIALOG:
             {
+                // deleting the duplicate of visible cursor message can cause 
hyperlink popup not to show up on second/or more click on the same place.
+                // If the hyperlink is not empty we can bypass that to show 
the popup
+                const bool hyperLinkException = type == 
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR &&
+                    payload.find("\"hyperlink\":\"\"") == std::string::npos &&
+                    payload.find("\"hyperlink\": {}") == std::string::npos;
                 const int nViewId = lcl_getViewId(payload);
                 removeAll(
-                    [type, nViewId] (const queue_type::value_type& elem) {
-                        return (elem.Type == type && nViewId == 
lcl_getViewId(elem));
+                    [type, nViewId, hyperLinkException] (const 
queue_type::value_type& elem) {
+                        return (elem.Type == type && nViewId == 
lcl_getViewId(elem) && !hyperLinkException);
                     }
                 );
             }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to