summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-14 16:00:57 +0530
committerpranavk <pranavk@collabora.co.uk>2017-11-15 13:44:43 +0100
commita088f9e729084f950ee58afb8f80e64d4d134144 (patch)
tree6e89d908542583dc5d1664708800369253025013 /vcl/source
parent8aa381f8a15a37017ce8b3d01387214125e35b93 (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>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/edit.cxx14
-rw-r--r--vcl/source/window/dialog.cxx10
2 files changed, 24 insertions, 0 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 8edf98b274e1..cf8a153ee256 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/lok.hxx>
+
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/cursor.hxx>
@@ -1143,6 +1145,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 tools::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 a409bdc6e126..8e6d5f101012 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1015,6 +1015,16 @@ void Dialog::LOKKeyUp(const KeyEvent& rKeyEvent)
ImplWindowFrameProc(this, SalEvent::ExternalKeyUp, &rKeyEvent);
}
+void Dialog::LOKCursorInvalidate(const tools::Rectangle& aRect)
+{
+ assert(comphelper::LibreOfficeKit::isActive());
+
+ if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty())
+ {
+ mpDialogRenderable->notifyDialog(maID, "cursor_invalidate", &aRect);
+ }
+}
+
void Dialog::ensureRepaint()
{
// ensure repaint