diff options
Diffstat (limited to 'vcl/source/window/dialog.cxx')
-rw-r--r-- | vcl/source/window/dialog.cxx | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 7a2f6f158d84..6eab80b0c2f6 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -55,6 +55,7 @@ #include <vcl/settings.hxx> #include <vcl/uitest/uiobject.hxx> #include <vcl/virdev.hxx> +#include <vcl/IDialogRenderable.hxx> #include <salframe.hxx> #include <iostream> @@ -351,8 +352,6 @@ struct DialogImpl void Dialog::ImplInitDialogData() { - maID = mnLastDialogId++; - mpDialogNotifier = nullptr; mpWindowImpl->mbDialog = true; mpPrevExecuteDlg = nullptr; mbInExecute = false; @@ -480,8 +479,6 @@ void Dialog::ImplInitSettings() SetBackground(GetSettings().GetStyleSettings().GetDialogColor()); } -vcl::DialogID Dialog::mnLastDialogId = 1; - Dialog::Dialog( WindowType nType ) : SystemWindow( nType ) , mnInitFlag(InitFlag::Default) @@ -876,14 +873,6 @@ bool Dialog::selectPageByUIXMLDescription(const OString& /*rUIXMLDescription*/) return true; } -void Dialog::registerDialogNotifier(vcl::IDialogNotifier* pDialogNotifier) -{ - if (pDialogNotifier && !mpDialogNotifier) - { - mpDialogNotifier = pDialogNotifier; - } -} - void Dialog::paintDialog(VirtualDevice& rDevice) { setDeferredProperties(); @@ -956,29 +945,28 @@ void Dialog::LogicMouseMoveChild(const MouseEvent& rMouseEvent) void Dialog::InvalidateFloatingWindow(const Point& rPos) { - if (comphelper::LibreOfficeKit::isActive() && mpDialogNotifier && maID != 0) - { - mpDialogNotifier->notifyDialogChild(maID, "invalidate", rPos); - } + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + pNotifier->notifyDialogChild(GetLOKWindowId(), "invalidate", rPos); } void Dialog::CloseFloatingWindow() { - if (comphelper::LibreOfficeKit::isActive() && mpDialogNotifier && maID != 0) - { - mpDialogNotifier->notifyDialogChild(maID, "close", Point(0, 0)); - } + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + pNotifier->notifyDialogChild(GetLOKWindowId(), "close", Point(0, 0)); } void Dialog::LogicInvalidate(const Rectangle* pRectangle) { - if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogNotifier && maID != 0) + if (comphelper::LibreOfficeKit::isDialogPainting()) + return; + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) { std::vector<vcl::LOKPayloadItem> aPayload; if (pRectangle) aPayload.push_back(std::make_pair(OString("rectangle"), pRectangle->toString())); - mpDialogNotifier->notifyDialog(maID, "invalidate", aPayload); + pNotifier->notifyDialog(GetLOKWindowId(), "invalidate", aPayload); } } @@ -1024,10 +1012,11 @@ void Dialog::LOKCursor(const OUString& rAction, const std::vector<vcl::LOKPayloa { assert(comphelper::LibreOfficeKit::isActive()); - if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogNotifier && maID != 0) - { - mpDialogNotifier->notifyDialog(maID, rAction, rPayload); - } + if (comphelper::LibreOfficeKit::isDialogPainting()) + return; + + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + pNotifier->notifyDialog(GetLOKWindowId(), rAction, rPayload); } void Dialog::ensureRepaint() @@ -1356,11 +1345,12 @@ void Dialog::Resize() { SystemWindow::Resize(); + if (comphelper::LibreOfficeKit::isDialogPainting()) + return; + // inform LOK clients - if (!comphelper::LibreOfficeKit::isDialogPainting() && mpDialogNotifier && maID != 0) - { - mpDialogNotifier->notifyDialog(maID, "invalidate"); - } + if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier()) + pNotifier->notifyDialog(GetLOKWindowId(), "invalidate"); } bool Dialog::set_property(const OString &rKey, const OString &rValue) |