diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-14 16:00:57 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-16 10:07:34 +0100 |
commit | 135b86cee45d20fbd8b1253954443be07d7f4abc (patch) | |
tree | 6ee0c4254b904a408d3bd5c15edf73819a86c0db | |
parent | b4b8c72b4aab34c62ceccb2075720226da485870 (diff) |
lokdialog: Callback for dialog cursor invalidation
Change-Id: Iecadb68737ed7b1a425d9ea633976fb24d1055c6
Reviewed-on: https://gerrit.libreoffice.org/44721
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
-rw-r--r-- | include/vcl/dialog.hxx | 1 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 14 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index 9048d0e41dbe..e1cb91d1dac1 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -87,6 +87,7 @@ public: void LOKKeyInput(const KeyEvent& rKeyEvent); void LOKKeyUp(const KeyEvent& rKeyEvent); + void LOKCursorInvalidate(const Rectangle& rRect); protected: explicit Dialog( WindowType nType ); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index fe7f6f976ffc..6f8dd26a2ba3 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -18,6 +18,8 @@ */ #include <tools/rc.h> +#include <comphelper/lok.hxx> + #include <vcl/decoview.hxx> #include <vcl/event.hxx> #include <vcl/cursor.hxx> @@ -1155,6 +1157,18 @@ void Edit::ImplShowCursor( bool bOnlyIfVisible ) pCursor->SetSize( Size( nCursorWidth, nTextHeight ) ); pCursor->Show(); } + + if (comphelper::LibreOfficeKit::isActive()) + { + const long X = GetOutOffXPixel() + pCursor->GetPos().X(); + const long Y = GetOutOffYPixel() + pCursor->GetPos().Y(); + if (nCursorWidth == 0) + nCursorWidth = 2; + const Rectangle aRect(Point(X, Y), Size(nCursorWidth, pCursor->GetHeight())); + Dialog* pParentDlg = GetParentDialog(); + if (pParentDlg) + pParentDlg->LOKCursorInvalidate(aRect); + } } void Edit::ImplAlign() diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 73674200d914..0137b0950a3b 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1016,6 +1016,16 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent) ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent); } +void Dialog::LOKCursorInvalidate(const Rectangle& aRect) +{ + assert(comphelper::LibreOfficeKit::isActive()); + + if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty()) + { + mpDialogRenderable->notifyDialog(maID, "cursor_invalidate", &aRect); + } +} + void Dialog::ensureRepaint() { // ensure repaint |