desktop/source/lib/init.cxx                  |    1 +
 include/LibreOfficeKit/LibreOfficeKitEnums.h |    2 +-
 include/vcl/unohelp2.hxx                     |    3 ++-
 sc/source/ui/view/editsh.cxx                 |    8 +-------
 sc/source/ui/view/gridwin.cxx                |    1 +
 sd/source/ui/view/drviews2.cxx               |   12 +-----------
 sw/source/uibase/shells/textsh1.cxx          |    8 +-------
 vcl/source/app/unohelp2.cxx                  |    6 +++---
 8 files changed, 11 insertions(+), 30 deletions(-)

New commits:
commit 4f8c5f241d21348b1cd0e427fb7acd67c095630f
Author:     Gökay Şatır <gokay.sa...@collabora.com>
AuthorDate: Sun Mar 14 12:36:30 2021 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Apr 7 22:42:51 2021 +0200

    Calc: Update selected cell range before calculating the selection area.
    
    Change-Id: I7a814be03acb246e1eb9d68425418ee1357510fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112472
    Tested-by: Jenkins
    Reviewed-by: Dennis Francis <dennis.fran...@collabora.com>
    Reviewed-by: Gökay ŞATIR <gokaysa...@collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b0365e89ed50..55d5f00ae874 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1441,6 +1441,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
         case LOK_CALLBACK_CELL_VIEW_CURSOR:
         case LOK_CALLBACK_CELL_FORMULA:
         case LOK_CALLBACK_CELL_ADDRESS:
+        case LOK_CALLBACK_CELL_SELECTION_AREA:
         case LOK_CALLBACK_CURSOR_VISIBLE:
         case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
         case LOK_CALLBACK_SET_PART:
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index f075ab8c78cf..dc9cc1c68946 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5920,6 +5920,7 @@ void ScGridWindow::UpdateKitSelection(const 
std::vector<tools::Rectangle>& rRect
     }
 
     ScTabViewShell* pViewShell = mrViewData.GetViewShell();
+    pViewShell->UpdateInputHandler();
     OString sBoundingBoxString = "EMPTY";
     if (!aBoundingBox.IsEmpty())
         sBoundingBoxString = aBoundingBox.toString();
commit a9da7089befaf3b2cf1a3af60ccbdb0298a495cc
Author:     gokaysatir <gokaysa...@collabora.com>
AuthorDate: Wed Oct 7 12:57:13 2020 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Apr 7 22:41:55 2021 +0200

    Online: "Copy hyperlink location" feature improvement.
    
    Lambda functions are replaced with class pointers.
    
    Change-Id: I48628d3105533aad2463bd8ade1f65cf5b154b0f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104058
    Tested-by: Jenkins
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 9a0eb01ca840..ae8eacd9151f 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -646,7 +646,7 @@ typedef enum
      *
      * Payload is optional. When payload is empty, Online gets string from 
selected text.
      * Payload format is JSON.
-     * Example: { "mimeType": "string", "content": "some content" }
+     * Example: { "mimeType": "text/plain", "content": "some content" }
      */
     LOK_CALLBACK_CLIPBOARD_CHANGED = 38,
 
diff --git a/include/vcl/unohelp2.hxx b/include/vcl/unohelp2.hxx
index 91c4ce6ce0e2..a0e03a04e2a1 100644
--- a/include/vcl/unohelp2.hxx
+++ b/include/vcl/unohelp2.hxx
@@ -28,6 +28,7 @@
 #include <comphelper/lok.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 #include <boost/property_tree/json_parser.hpp>
+#include <vcl/IDialogRenderable.hxx>
 
 namespace com::sun::star::datatransfer::clipboard {
     class XClipboard;
@@ -60,7 +61,7 @@ namespace vcl::unohelper {
         static  void    CopyStringTo(
             const OUString& rContent,
             const css::uno::Reference< 
css::datatransfer::clipboard::XClipboard >& rxClipboard,
-            std::function<void (int, const char*)> *callback = nullptr
+            const vcl::ILibreOfficeKitNotifier* pNotifier = nullptr
         );
     };
 
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index e12c5460c09d..619001a27d8c 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -642,13 +642,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
                 {
                     uno::Reference<datatransfer::clipboard::XClipboard> 
xClipboard = GetSystemClipboard();
 
-                    if (comphelper::LibreOfficeKit::isActive())
-                    {
-                        std::function<void (int, const char*)> callback = [&] 
(int callbackType, const char* text) { 
rViewData.GetViewShell()->libreOfficeKitViewCallback(callbackType, text); } ;
-                        
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
&callback);
-                    }
-                    else
-                        
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
nullptr);
+                    
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
SfxViewShell::Current());
                 }
             }
         break;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 4178150e872a..cc7b1eec8011 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2258,17 +2258,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
                     uno::Reference<datatransfer::clipboard::XClipboard> 
xClipboard
                         = pOutView->GetWindow()->GetClipboard();
 
-                    if (comphelper::LibreOfficeKit::isActive())
-                    {
-                        std::function<void (int, const char*)> callback = [&] 
(int callbackType, const char* text)
-                        {
-                            SfxViewFrame* pFrame = GetViewFrame();
-                            
pFrame->GetViewShell()->libreOfficeKitViewCallback(callbackType, text);
-                        };
-                        
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
&callback);
-                    }
-                    else
-                        
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard);
+                    
vcl::unohelper::TextDataObject::CopyStringTo(pURLField->GetURL(), xClipboard, 
SfxViewShell::Current());
                 }
             }
 
diff --git a/sw/source/uibase/shells/textsh1.cxx 
b/sw/source/uibase/shells/textsh1.cxx
index 72068a2045c4..35af8293101e 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1353,13 +1353,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
                 OUString hyperlinkLocation = rINetFormat.GetValue();
                 ::uno::Reference< datatransfer::clipboard::XClipboard > 
xClipboard = GetView().GetEditWin().GetClipboard();
 
-                if (comphelper::LibreOfficeKit::isActive())
-                {
-                    std::function<void (int, const char*)> callback = [&] (int 
callbackType, const char* text) { 
GetView().libreOfficeKitViewCallback(callbackType, text); } ;
-                    
vcl::unohelper::TextDataObject::CopyStringTo(hyperlinkLocation, xClipboard, 
&callback );
-                }
-                else
-                    
vcl::unohelper::TextDataObject::CopyStringTo(hyperlinkLocation, xClipboard, 
nullptr );
+                
vcl::unohelper::TextDataObject::CopyStringTo(hyperlinkLocation, xClipboard, 
SfxViewShell::Current());
             }
             else
                 rWrtSh.ClickToINetAttr(rINetFormat);
diff --git a/vcl/source/app/unohelp2.cxx b/vcl/source/app/unohelp2.cxx
index 8e33aeefc55a..bc3e64573ab2 100644
--- a/vcl/source/app/unohelp2.cxx
+++ b/vcl/source/app/unohelp2.cxx
@@ -41,7 +41,7 @@ namespace vcl::unohelper {
 
     void TextDataObject::CopyStringTo( const OUString& rContent,
         const uno::Reference< datatransfer::clipboard::XClipboard >& 
rxClipboard,
-        std::function<void (int, const char*)> *callback)
+        const vcl::ILibreOfficeKitNotifier* pNotifier)
     {
         SAL_WARN_IF( !rxClipboard.is(), "vcl", "TextDataObject::CopyStringTo: 
invalid clipboard!" );
         if ( !rxClipboard.is() )
@@ -58,14 +58,14 @@ namespace vcl::unohelper {
             if( xFlushableClipboard.is() )
                 xFlushableClipboard->flushClipboard();
 
-            if (callback != nullptr && comphelper::LibreOfficeKit::isActive())
+            if (pNotifier != nullptr && comphelper::LibreOfficeKit::isActive())
             {
                 boost::property_tree::ptree aTree;
                 aTree.put("content", rContent);
                 aTree.put("mimeType", "text/plain");
                 std::stringstream aStream;
                 boost::property_tree::write_json(aStream, aTree);
-                (*callback)(LOK_CALLBACK_CLIPBOARD_CHANGED, 
aStream.str().c_str());
+                
pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_CLIPBOARD_CHANGED, 
aStream.str().c_str());
             }
         }
         catch( const uno::Exception& )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to