desktop/source/lib/init.cxx                  |    6 +
 include/LibreOfficeKit/LibreOfficeKitEnums.h |    8 +
 libreofficekit/source/gtk/lokdocview.cxx     |    1 
 sc/source/ui/app/inputhdl.cxx                |   65 +++++++++++++-
 sc/source/ui/app/inputwin.cxx                |  125 ++++++++++++++++++++++++---
 sc/source/ui/inc/inputwin.hxx                |    5 +
 sc/source/ui/view/tabvwshc.cxx               |   11 ++
 vcl/source/window/cursor.cxx                 |    4 
 8 files changed, 211 insertions(+), 14 deletions(-)

New commits:
commit e6c305c61241470fd4263f897556cafca3eaf83a
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Mon Nov 25 21:35:42 2019 +0100
Commit:     Marco Cecchetti <marco.cecche...@collabora.com>
CommitDate: Tue Nov 26 08:54:22 2019 +0100

    lok: calc formula bar tunneling: function list callback
    
    Added a lok callback for sending the list of functions matching the
    current characters typed by the user.
    
    Change-Id: Ia971fc55ec5eb961b4098592a8049dd0eed3ba14

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 929b84e4d681..5a9cd839fd0c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1183,6 +1183,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
         case LOK_CALLBACK_TEXT_VIEW_SELECTION:
         case LOK_CALLBACK_INVALIDATE_HEADER:
         case LOK_CALLBACK_WINDOW:
+        case LOK_CALLBACK_CALC_FUNCTION_LIST:
         {
             const auto& pos = std::find_if(m_queue.rbegin(), m_queue.rend(),
                     [type] (const queue_type::value_type& elem) { return 
(elem.Type == type); });
@@ -1259,6 +1260,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
             case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
             case LOK_CALLBACK_TEXT_VIEW_SELECTION:
             case LOK_CALLBACK_VIEW_CURSOR_VISIBLE:
+            case LOK_CALLBACK_CALC_FUNCTION_LIST:
             {
                 const int nViewId = lcl_getViewId(payload);
                 removeAll(
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index bfc9a12da9db..a564d140efdb 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -714,6 +714,12 @@ typedef enum
      * the description.
      */
     LOK_CALLBACK_JSDIALOG = 46,
+
+    /**
+     * Send the list of functions whose name starts with the characters entered
+     * by the user in the formula input bar.
+     */
+    LOK_CALLBACK_CALC_FUNCTION_LIST = 47
 }
 LibreOfficeKitCallbackType;
 
@@ -836,6 +842,8 @@ static inline const char* lokCallbackTypeToString(int nType)
         return "LOK_CALLBACK_REFERENCE_MARKS";
     case LOK_CALLBACK_JSDIALOG:
         return "LOK_CALLBACK_JSDIALOG";
+    case LOK_CALLBACK_CALC_FUNCTION_LIST:
+        return "LOK_CALLBACK_CALC_FUNCTION_LIST";
     }
 
     assert(!"Unknown LibreOfficeKitCallbackType type.");
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index f8815e673458..87fe7689ce0e 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1376,6 +1376,7 @@ callback (gpointer pData)
     case LOK_CALLBACK_CELL_AUTO_FILL_AREA:
     case LOK_CALLBACK_TABLE_SELECTED:
     case LOK_CALLBACK_JSDIALOG:
+    case LOK_CALLBACK_CALC_FUNCTION_LIST:
     {
         // TODO: Implement me
         break;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 669218f5b164..746909dd1f2d 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1031,6 +1031,11 @@ bool lcl_hasSingleToken(const OUString& s, sal_Unicode c)
 
 void ScInputHandler::ShowArgumentsTip( OUString& rSelText )
 {
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        return;
+    }
+
     ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
     const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep);
     const sal_Unicode cSheetSep = 
lcl_getSheetSeparator(&pDocSh->GetDocument());
@@ -1285,6 +1290,58 @@ bool ScInputHandler::GetFuncName( OUString& aStart, 
OUString& aResult )
 
 void ScInputHandler::ShowFuncList( const ::std::vector< OUString > & 
rFuncStrVec )
 {
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        SfxViewShell* pViewShell = SfxViewShell::Current();
+        if (pViewShell && rFuncStrVec.size())
+        {
+            OUString aFuncNameStr;
+            OUString aDescFuncNameStr;
+            OStringBuffer aPayload;
+            aPayload.append("[ ");
+            for (const OUString& rFunc : rFuncStrVec)
+            {
+                if ( rFunc[rFunc.getLength()-1] == cParenthesesReplacement )
+                {
+                    aFuncNameStr = rFunc.copy(0, rFunc.getLength()-1);
+                }
+                else
+                {
+                    aFuncNameStr = rFunc;
+                }
+
+                FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr());
+                aDescFuncNameStr = aFuncNameStr + "()";
+                sal_Int32 nNextFStart = 0;
+                const IFunctionDescription* ppFDesc;
+                ::std::vector< OUString > aArgs;
+                OUString eqPlusFuncName = "=" + aDescFuncNameStr;
+                if ( aHelper.GetNextFunc( eqPlusFuncName, false, nNextFStart, 
nullptr, &ppFDesc, &aArgs ) )
+                {
+                    if ( !ppFDesc->getFunctionName().isEmpty() )
+                    {
+                        aPayload.append("{");
+                        aPayload.append("\"signature\": \"");
+                        OUString aSignature = ppFDesc->getSignature();
+                        aPayload.append(OUStringToOString(aSignature, 
RTL_TEXTENCODING_UTF8));
+                        aPayload.append("\", ");
+                        aPayload.append("\"description\": \"");
+                        OUString aFuncDescr = ppFDesc->getDescription();
+                        aPayload.append(OUStringToOString(aFuncDescr, 
RTL_TEXTENCODING_UTF8));
+                        aPayload.append("\"}, ");
+                    }
+                }
+            }
+            sal_Int32 nLen = aPayload.getLength();
+            aPayload[nLen - 2] = ' ';
+            aPayload[nLen - 1] = ']';
+
+            OString s = aPayload.makeStringAndClear();
+            
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CALC_FUNCTION_LIST, 
s.getStr());
+        }
+        return;
+    }
+
     OUStringBuffer aTipStr;
     OUString aFuncNameStr;
     OUString aDescFuncNameStr;
commit 079eefbc452b9b0d143d40c3bb0e05d597da2149
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Wed Nov 20 18:32:25 2019 +0100
Commit:     Marco Cecchetti <marco.cecche...@collabora.com>
CommitDate: Tue Nov 26 08:54:22 2019 +0100

    lok: calc formula bar tunneling: resize the main window
    
    When a resize msg is forwarded from the client to the core for the
    formula bar, for instance because of a browser window resizing, we
    need to resize the whole main app window not the formula bar only.
    On the contrary we have 2 issues:
    1) each time the formula bar get focus the layout manager tries to set
    the size of the formula bar back so that it fits inside the app window
    2) the part of the formula bar outside the app window doesn't respond
    to mouse events on the client side.
    
    Change-Id: I13ddc40a2a8e543808a4bf36a04022deb3700163

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 29a810ff284a..6bbbd9dcfe22 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -491,6 +491,28 @@ void ScInputWindow::PixelInvalidate(const 
tools::Rectangle* pRectangle)
     }
 }
 
+void ScInputWindow::SetSizePixel( const Size& rNewSize )
+{
+    const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier();
+    if (pNotifier)
+    {
+        if (vcl::Window* pFrameWindowImpl = GetParent())
+        {
+            if (vcl::Window* pWorkWindow = pFrameWindowImpl->GetParent())
+            {
+                if (vcl::Window* pImplBorderWindow = pWorkWindow->GetParent())
+                {
+                    Size aSize = pImplBorderWindow->GetSizePixel();
+                    aSize.setWidth(rNewSize.getWidth());
+                    pImplBorderWindow->SetSizePixel(aSize);
+                }
+            }
+        }
+    }
+
+    ToolBox::SetSizePixel(rNewSize);
+}
+
 void ScInputWindow::Resize()
 {
     ToolBox::Resize();
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 8df165e5af1c..5bb9ea45b08e 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -227,6 +227,7 @@ public:
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect ) override;
     virtual void    PixelInvalidate(const tools::Rectangle* pRectangle) 
override;
+    virtual void    SetSizePixel( const Size& rNewSize ) override;
     virtual void    Resize() override;
     virtual void    Select() override;
 
commit 0ca1d9601920025e832be20cdca5161342ca16d4
Author:     Marco Cecchetti <marco.cecche...@collabora.com>
AuthorDate: Mon Nov 4 17:10:45 2019 +0100
Commit:     Marco Cecchetti <marco.cecche...@collabora.com>
CommitDate: Tue Nov 26 08:54:21 2019 +0100

    lok: calc formula bar tunneling
    
    Change-Id: I92026098222e04a163796225a048c6d7dc1b37c5

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index d48bcf2490a0..929b84e4d681 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3552,7 +3552,9 @@ static void 
doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned
         return;
     }
 
-    const Point aPos(nX, nY);
+    Size aOffset(pWindow->GetOutOffXPixel(), pWindow->GetOutOffYPixel());
+    Point aPos(nX, nY);
+    aPos.Move(aOffset);
     MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 
     if (Dialog* pDialog = dynamic_cast<Dialog*>(pWindow.get()))
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1bda18ad5b60..669218f5b164 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -777,6 +777,12 @@ ScInputHandler::ScInputHandler()
     pDelayTimer.reset( new Timer( "ScInputHandlerDelay timer" ) );
     pDelayTimer->SetTimeout( 500 ); // 500 ms delay
     pDelayTimer->SetInvokeHandler( LINK( this, ScInputHandler, DelayTimer ) );
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        ScInputHandler::bOptLoaded = true;            // Evaluate App options
+        ScInputHandler::bAutoComplete = true;         // Is set in KeyInput
+    }
 }
 
 ScInputHandler::~ScInputHandler()
@@ -3707,7 +3713,7 @@ void ScInputHandler::InputCommand( const CommandEvent& 
rCEvt )
             {
                 if (pTableView)
                     pTableView->Command( rCEvt );
-                if (pTopView)
+                if (pTopView && !comphelper::LibreOfficeKit::isActive())
                     pTopView->Command( rCEvt );
 
                 if ( rCEvt.GetCommand() == CommandEventId::EndExtTextInput )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 1105ff130988..29a810ff284a 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -172,6 +172,7 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
         pRuntimeWindow  ( lcl_chooseRuntimeImpl( this, pBind ) ),
         aTextWindow     ( *pRuntimeWindow ),
         pInputHdl       ( nullptr ),
+        mpViewShell     ( nullptr ),
         mnMaxY          (0),
         bIsOkCancelMode ( false ),
         bInResize       ( false )
@@ -188,10 +189,15 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
     }
     OSL_ENSURE( pViewSh, "no view shell for input window" );
 
+    mpViewShell = pViewSh;
+
     // Position window, 3 buttons, input window
-    InsertWindow    (1, aWndPos.get(), ToolBoxItemBits::NONE, 0);
-    InsertSeparator (1);
-    InsertItem      (SID_INPUT_FUNCTION, Image(StockImage::Yes, 
RID_BMP_INPUT_FUNCTION), ToolBoxItemBits::NONE, 2);
+    if (!comphelper::LibreOfficeKit::isActive())
+    {
+        InsertWindow    (1, aWndPos.get(), ToolBoxItemBits::NONE, 0);
+        InsertSeparator (1);
+        InsertItem      (SID_INPUT_FUNCTION, Image(StockImage::Yes, 
RID_BMP_INPUT_FUNCTION), ToolBoxItemBits::NONE, 2);
+    }
     InsertItem      (SID_INPUT_SUM,      Image(StockImage::Yes, 
RID_BMP_INPUT_SUM), ToolBoxItemBits::NONE, 3);
     InsertItem      (SID_INPUT_EQUAL,    Image(StockImage::Yes, 
RID_BMP_INPUT_EQUAL), ToolBoxItemBits::NONE, 4);
     InsertItem      (SID_INPUT_CANCEL,   Image(StockImage::Yes, 
RID_BMP_INPUT_CANCEL), ToolBoxItemBits::NONE, 5);
@@ -199,14 +205,20 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
     InsertSeparator (7);
     InsertWindow    (7, &aTextWindow, ToolBoxItemBits::NONE, 8);
 
-    aWndPos   ->SetQuickHelpText(ScResId(SCSTR_QHELP_POSWND));
-    aWndPos   ->SetHelpId       (HID_INSWIN_POS);
+    if (!comphelper::LibreOfficeKit::isActive())
+    {
+        aWndPos   ->SetQuickHelpText(ScResId(SCSTR_QHELP_POSWND));
+        aWndPos   ->SetHelpId       (HID_INSWIN_POS);
+    }
     aTextWindow.SetQuickHelpText(ScResId(SCSTR_QHELP_INPUTWND));
     aTextWindow.SetHelpId       (HID_INSWIN_INPUT);
 
-    // No SetHelpText: the helptexts come from the Help
-    SetItemText (SID_INPUT_FUNCTION, ScResId(SCSTR_QHELP_BTNCALC));
-    SetHelpId   (SID_INPUT_FUNCTION, HID_INSWIN_CALC);
+    if (!comphelper::LibreOfficeKit::isActive())
+    {
+        // No SetHelpText: the helptexts come from the Help
+        SetItemText (SID_INPUT_FUNCTION, ScResId(SCSTR_QHELP_BTNCALC));
+        SetHelpId   (SID_INPUT_FUNCTION, HID_INSWIN_CALC);
+    }
 
     SetItemText (SID_INPUT_SUM, ScResId( SCSTR_QHELP_BTNSUM ) );
     SetHelpId   (SID_INPUT_SUM, HID_INSWIN_SUMME);
@@ -228,7 +240,8 @@ ScInputWindow::ScInputWindow( vcl::Window* pParent, const 
SfxBindings* pBind ) :
 
     SetHelpId( HID_SC_INPUTWIN ); // For the whole input row
 
-    aWndPos   ->Show();
+    if (!comphelper::LibreOfficeKit::isActive())
+        aWndPos   ->Show();
     aTextWindow.Show();
 
     pInputHdl = SC_MOD()->GetInputHdl( pViewSh, false ); // use own handler 
even if ref-handler is set
@@ -289,6 +302,15 @@ void ScInputWindow::dispose()
         }
     }
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+        {
+            pNotifier->notifyWindow(GetLOKWindowId(), "close");
+            ReleaseLOKNotifier();
+        }
+    }
+
     pRuntimeWindow.disposeAndClear();
     aWndPos.disposeAndClear();
 
@@ -437,6 +459,9 @@ void ScInputWindow::Select()
 
 void ScInputWindow::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect)
 {
+    if (comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isDialogPainting())
+        return;
+
     ToolBox::Paint(rRenderContext, rRect);
 
     // draw a line at the bottom to distinguish that from the grid
@@ -449,6 +474,23 @@ void ScInputWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::Recta
                             Point(aSize.Width() - 1, aSize.Height() - 1));
 }
 
+void ScInputWindow::PixelInvalidate(const tools::Rectangle* pRectangle)
+{
+    if (comphelper::LibreOfficeKit::isDialogPainting() || 
!comphelper::LibreOfficeKit::isActive())
+        return;
+
+    if (pRectangle)
+    {
+        const Point aPos(pRectangle->getX() - GetOutOffXPixel(), 
pRectangle->getY() - GetOutOffYPixel());
+        const tools::Rectangle aRect(aPos, pRectangle->GetSize());
+        Window::PixelInvalidate(&aRect);
+    }
+    else
+    {
+        Window::PixelInvalidate(nullptr);
+    }
+}
+
 void ScInputWindow::Resize()
 {
     ToolBox::Resize();
@@ -469,9 +511,37 @@ void ScInputWindow::Resize()
             aSize.AdjustHeight(pGroupBar->GetVertOffset() + ADDITIONAL_SPACE );
     }
     SetSizePixel(aSize);
+
+    if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+    {
+        std::vector<vcl::LOKPayloadItem> aItems;
+        aItems.emplace_back("size", GetSizePixel().toString());
+        pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
+    }
+
     Invalidate();
 }
 
+void ScInputWindow::NotifyLOKClient()
+{
+    if (comphelper::LibreOfficeKit::isActive() && !GetLOKNotifier() && 
mpViewShell)
+        SetLOKNotifier(mpViewShell);
+
+    if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+    {
+        Size aSize = GetSizePixel();
+        if (aSize.Width() != 0 && aSize.Height() != 0)
+        {
+            std::vector<vcl::LOKPayloadItem> aItems;
+            aItems.emplace_back("type", "calc-input-win");
+            aItems.emplace_back(std::make_pair("position", Point(0, 
0).toString()));
+            aItems.emplace_back(std::make_pair("size", aSize.toString()));
+            pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+        }
+
+    }
+}
+
 void ScInputWindow::SetFuncString( const OUString& rString, bool bDoEdit )
 {
     //! new method at ScModule to query if function autopilot is open
@@ -1005,6 +1075,10 @@ void ScInputBarGroup::TextGrabFocus()
 
 void ScTextWnd::Paint( vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect )
 {
+    if (comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isDialogPainting())
+        return;
+
+    tools::Rectangle aRect = comphelper::LibreOfficeKit::isActive() ? 
this->PixelToLogic(rRect) : rRect;
     EditView* pView = GetEditView();
     if (pView)
     {
@@ -1013,7 +1087,7 @@ void ScTextWnd::Paint( vcl::RenderContext& 
rRenderContext, const tools::Rectangl
             pView->Invalidate();
             mbInvalidate = false;
         }
-        mpEditView->Paint(rRect, &rRenderContext);
+        mpEditView->Paint(aRect, &rRenderContext);
     }
 }
 
@@ -1401,6 +1475,15 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
                 }
             }
         }
+        else if ( nCommand == CommandEventId::EndExtTextInput )
+        {
+            if (bFormulaMode)
+            {
+                ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
+                if (pHdl)
+                    pHdl->InputCommand(rCEvt);
+            }
+        }
         else if ( nCommand == CommandEventId::CursorPos )
         {
             //  don't call InputChanged for CommandEventId::CursorPos
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index 14ccb55dd4f3..8df165e5af1c 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -226,6 +226,7 @@ public:
     virtual void    dispose() override;
 
     virtual void    Paint( vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect ) override;
+    virtual void    PixelInvalidate(const tools::Rectangle* pRectangle) 
override;
     virtual void    Resize() override;
     virtual void    Select() override;
 
@@ -263,6 +264,8 @@ public:
     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) override;
     virtual void    MouseMove( const MouseEvent& rMEvt ) override;
 
+    void            NotifyLOKClient();
+
 private:
     bool IsPointerAtResizePos();
 
@@ -270,6 +273,7 @@ private:
     VclPtr<ScTextWndBase> pRuntimeWindow;
     ScTextWndBase&  aTextWindow;
     ScInputHandler* pInputHdl;
+    ScTabViewShell* mpViewShell;
     long            mnMaxY;
     bool            bIsOkCancelMode;
     bool            bInResize;
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 12d57de75962..38192b0206b9 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -60,6 +60,7 @@
 #include <xmlsourcedlg.hxx>
 #include <condformatdlgitem.hxx>
 #include <formdata.hxx>
+#include <inputwin.hxx>
 
 #include <RandomNumberGeneratorDialog.hxx>
 #include <SamplingDialog.hxx>
@@ -514,6 +515,16 @@ int ScTabViewShell::getPart() const
 void ScTabViewShell::afterCallbackRegistered()
 {
     UpdateInputHandler(true, false);
+
+    ScInputHandler* pHdl = mpInputHandler ? mpInputHandler.get() : 
SC_MOD()->GetInputHdl();
+    if (pHdl)
+    {
+        ScInputWindow* pInputWindow = pHdl->GetInputWindow();
+        if (pInputWindow)
+        {
+            pInputWindow->NotifyLOKClient();
+        }
+    }
 }
 
 void ScTabViewShell::NotifyCursor(SfxViewShell* pOtherShell) const
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index 483c9205d37a..3504f86b3924 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -227,8 +227,8 @@ void vcl::Cursor::LOKNotify( vcl::Window* pWindow, const 
OUString& rAction )
             aItems.emplace_back("visible", mpData->mbCurVisible ? "true" : 
"false");
         else if (rAction == "cursor_invalidate")
         {
-            const long nX = pWindow->GetOutOffXPixel() + 
pWindow->LogicToPixel(GetPos()).X();
-            const long nY = pWindow->GetOutOffYPixel() + 
pWindow->LogicToPixel(GetPos()).Y();
+            const long nX = pWindow->GetOutOffXPixel() + 
pWindow->LogicToPixel(GetPos()).X() - pParent->GetOutOffXPixel();
+            const long nY = pWindow->GetOutOffYPixel() + 
pWindow->LogicToPixel(GetPos()).Y() - pParent->GetOutOffYPixel();
             Size aSize = pWindow->LogicToPixel(GetSize());
             if (!aSize.Width())
                 aSize.setWidth( 
pWindow->GetSettings().GetStyleSettings().GetCursorSize() );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to