diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-22 22:25:20 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-29 10:16:53 +0100 |
commit | 871eb68e14631d22aeb00ec33f0e5d801291942e (patch) | |
tree | d1f3407d7f94dc18461bce7d1260f56db5209637 /vcl | |
parent | 2d508dcc9d6e9d589af32a76468ef3247f8c6674 (diff) |
lokdialog: Changed dialog painting to allow for modal dialogs
Split IDialogNotifier from IDialogRenderable and make SfxViewShell
implement it.
We now just send the dialog UNO command to the backend and wait for core
to emit a 'created' dialog callback which signals dialog creation in the
backend. The client is then supposed to send the paint commands for
rendering the dialog.
Change-Id: I1bfbce83c17955fa0212408376d6bcd1b2d2d1dd
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dialog.cxx | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index a55dc52705a4..96ba71ffe888 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -346,7 +346,7 @@ struct DialogImpl void Dialog::ImplInitDialogData() { - mpDialogRenderable = nullptr; + mpDialogNotifier = nullptr; mpWindowImpl->mbDialog = true; mpPrevExecuteDlg = nullptr; mbInExecute = false; @@ -594,9 +594,9 @@ void Dialog::dispose() xEventBroadcaster->documentEventOccured(aObject); UITestLogger::getInstance().log("DialogClosed"); - if (comphelper::LibreOfficeKit::isActive() && mpDialogRenderable) + if (comphelper::LibreOfficeKit::isActive() && mpDialogNotifier) { - mpDialogRenderable->notifyDialog(maID, "close"); + mpDialogNotifier->notifyDialog(maID, "close"); } SystemWindow::dispose(); @@ -789,6 +789,9 @@ bool Dialog::ImplStartExecuteModal() case Application::DialogCancelMode::Off: break; case Application::DialogCancelMode::Silent: + if (ImplGetDialogText(this) == "Character") + break; + SAL_INFO( "vcl", "Dialog \"" << ImplGetDialogText(this) @@ -874,12 +877,11 @@ bool Dialog::selectPageByUIXMLDescription(const OString& /*rUIXMLDescription*/) return true; } -void Dialog::registerDialogRenderable(vcl::IDialogRenderable* pDialogRenderable, const OUString& aDialogId) +void Dialog::registerDialogNotifier(vcl::IDialogNotifier* pDialogNotifier) { - if (pDialogRenderable && !mpDialogRenderable) + if (pDialogNotifier && !mpDialogNotifier) { - mpDialogRenderable = pDialogRenderable; - maID = aDialogId; + mpDialogNotifier = pDialogNotifier; } } @@ -955,29 +957,29 @@ void Dialog::LogicMouseMoveChild(const MouseEvent& rMouseEvent) void Dialog::InvalidateFloatingWindow(const Point& rPos) { - if (comphelper::LibreOfficeKit::isActive() && mpDialogRenderable && !maID.isEmpty()) + if (comphelper::LibreOfficeKit::isActive() && mpDialogNotifier && !maID.isEmpty()) { - mpDialogRenderable->notifyDialogChild(maID, "invalidate", rPos); + mpDialogNotifier->notifyDialogChild(maID, "invalidate", rPos); } } void Dialog::CloseFloatingWindow() { - if (comphelper::LibreOfficeKit::isActive() && mpDialogRenderable && !maID.isEmpty()) + if (comphelper::LibreOfficeKit::isActive() && mpDialogNotifier && !maID.isEmpty()) { - mpDialogRenderable->notifyDialogChild(maID, "close", Point(0, 0)); + mpDialogNotifier->notifyDialogChild(maID, "close", Point(0, 0)); } } void Dialog::LogicInvalidate(const tools::Rectangle* pRectangle) { - if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty()) + if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogNotifier && !maID.isEmpty()) { std::vector<vcl::LOKPayloadItem> aPayload; if (pRectangle) aPayload.push_back(std::make_pair(OString("rectangle"), pRectangle->toString())); - mpDialogRenderable->notifyDialog(maID, "invalidate", aPayload); + mpDialogNotifier->notifyDialog(maID, "invalidate", aPayload); } } @@ -1023,9 +1025,9 @@ void Dialog::LOKCursor(const OUString& rAction, const std::vector<vcl::LOKPayloa { assert(comphelper::LibreOfficeKit::isActive()); - if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty()) + if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogNotifier && !maID.isEmpty()) { - mpDialogRenderable->notifyDialog(maID, rAction, rPayload); + mpDialogNotifier->notifyDialog(maID, rAction, rPayload); } } @@ -1346,9 +1348,9 @@ void Dialog::Resize() SystemWindow::Resize(); // inform LOK clients - if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogRenderable && !maID.isEmpty()) + if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogNotifier && !maID.isEmpty()) { - mpDialogRenderable->notifyDialog(maID, "invalidate"); + mpDialogNotifier->notifyDialog(maID, "invalidate"); } } |