diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-01 14:27:21 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-12-04 17:14:03 +0530 |
commit | b1bcc70d2a5a51d2cb4b2e9e2a8e6641719fe18b (patch) | |
tree | 0347b8a69436f99c889b57b9072fc34fffaaea63 /desktop/source/lib | |
parent | ae412b57e3f7866e24b120f0afb8ac80618a8d07 (diff) |
lokdialog: Merge dialog & dialog child mouse event APIs into one
Change-Id: I91aaa6a58f33dd2d817e02533de96e0c8191f2ca
Diffstat (limited to 'desktop/source/lib')
-rw-r--r-- | desktop/source/lib/init.cxx | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 4e0da17fa091..b5bc0f56a845 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -556,7 +556,7 @@ static void doc_postMouseEvent (LibreOfficeKitDocument* pThis, int nCount, int nButtons, int nModifier); -static void doc_postDialogMouseEvent (LibreOfficeKitDocument* pThis, +static void doc_postWindowMouseEvent (LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, int nType, int nX, @@ -564,14 +564,6 @@ static void doc_postDialogMouseEvent (LibreOfficeKitDocument* pThis, int nCount, int nButtons, int nModifier); -static void doc_postDialogChildMouseEvent (LibreOfficeKitDocument* pThis, - unsigned nLOKWindowId, - int nType, - int nX, - int nY, - int nCount, - int nButtons, - int nModifier); static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pCommand, const char* pArguments, @@ -646,8 +638,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->postKeyEvent = doc_postKeyEvent; m_pDocumentClass->postWindowKeyEvent = doc_postWindowKeyEvent; m_pDocumentClass->postMouseEvent = doc_postMouseEvent; - m_pDocumentClass->postDialogMouseEvent = doc_postDialogMouseEvent; - m_pDocumentClass->postDialogChildMouseEvent = doc_postDialogChildMouseEvent; + m_pDocumentClass->postWindowMouseEvent = doc_postWindowMouseEvent; m_pDocumentClass->postUnoCommand = doc_postUnoCommand; m_pDocumentClass->setTextSelection = doc_setTextSelection; m_pDocumentClass->getTextSelection = doc_getTextSelection; @@ -2429,7 +2420,7 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, } } -static void doc_postDialogMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) +static void doc_postWindowMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) { SolarMutexGuard aGuard; @@ -2460,37 +2451,6 @@ static void doc_postDialogMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned } } -static void doc_postDialogChildMouseEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nX, int nY, int nCount, int nButtons, int nModifier) -{ - SolarMutexGuard aGuard; - - VclPtr<Window> pWindow = vcl::Window::FindLOKWindow(nLOKWindowId); - if (!pWindow) - { - gImpl->maLastExceptionMsg = "Document doesn't support dialog rendering, or window not found."; - return; - } - - Point aPos(nX, nY); - MouseEvent aEvent(aPos, nCount, MouseEventModifiers::SIMPLECLICK, nButtons, nModifier); - - switch (nType) - { - case LOK_MOUSEEVENT_MOUSEBUTTONDOWN: - pWindow->LogicMouseButtonDownChild(aEvent); - break; - case LOK_MOUSEEVENT_MOUSEBUTTONUP: - pWindow->LogicMouseButtonUpChild(aEvent); - break; - case LOK_MOUSEEVENT_MOUSEMOVE: - pWindow->LogicMouseMoveChild(aEvent); - break; - default: - assert(false); - break; - } -} - static void doc_setTextSelection(LibreOfficeKitDocument* pThis, int nType, int nX, int nY) { SolarMutexGuard aGuard; |