diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2024-12-10 12:38:04 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2024-12-12 06:50:15 +0100 |
commit | e6f54da28699fcf4fbbe3a042c0906cb5623b9f4 (patch) | |
tree | 651d3dd32124810d4b2232248e4a70f5ab7a2287 /vcl | |
parent | 3bc1608758e37cba4eac8ca201e4464cd081fd07 (diff) |
jsdialog: add const
Change-Id: If689daf52ca01904bc22c8f2e72f65247be2a3f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178334
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/jsdialog/jsdialogmessages.hxx | 12 | ||||
-rw-r--r-- | vcl/inc/jsdialog/jsdialogsender.hxx | 11 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogsender.cxx | 16 |
3 files changed, 21 insertions, 18 deletions
diff --git a/vcl/inc/jsdialog/jsdialogmessages.hxx b/vcl/inc/jsdialog/jsdialogmessages.hxx index ab0d016ca1af..0007c5195f60 100644 --- a/vcl/inc/jsdialog/jsdialogmessages.hxx +++ b/vcl/inc/jsdialog/jsdialogmessages.hxx @@ -99,25 +99,25 @@ class JSDialogNotifyIdle final : public Idle public: JSDialogNotifyIdle(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow, - const OUString& sTypeOfJSON); + const rtl::OUString& sTypeOfJSON); void Invoke() override; void clearQueue(); void forceUpdate(); template <class VclType> - void sendMessage(jsdialog::MessageType eType, const VclPtr<VclType>& pTarget, + void sendMessage(const jsdialog::MessageType eType, const VclPtr<VclType>& pTarget, std::unique_ptr<jsdialog::ActionDataMap> pData = nullptr); private: void send(const OString& sMsg); OString generateFullUpdate() const; - OString generateWidgetUpdate(VclPtr<vcl::Window> pWindow) const; + OString generateWidgetUpdate(const VclPtr<vcl::Window>& pWindow) const; OString generateCloseMessage() const; - OString generateActionMessage(VclPtr<vcl::Window> pWindow, + OString generateActionMessage(const VclPtr<vcl::Window>& pWindow, std::unique_ptr<jsdialog::ActionDataMap> pData) const; - OString generatePopupMessage(VclPtr<vcl::Window> pWindow, const rtl::OUString& sParentId, - const rtl::OUString& sCloseId) const; + OString generatePopupMessage(const VclPtr<vcl::Window>& pWindow, const rtl::OUString& sParentId, + const OUString& sCloseId) const; OString generateClosePopupMessage(const rtl::OUString& sWindowId) const; OString generateMenuMessage(const VclPtr<PopupMenu>& pMenu) const; }; diff --git a/vcl/inc/jsdialog/jsdialogsender.hxx b/vcl/inc/jsdialog/jsdialogsender.hxx index 85066e10f37d..44324fb07844 100644 --- a/vcl/inc/jsdialog/jsdialogsender.hxx +++ b/vcl/inc/jsdialog/jsdialogsender.hxx @@ -48,8 +48,8 @@ public: : m_bCanClose(true) { } - JSDialogSender(VclPtr<vcl::Window> aNotifierWindow, VclPtr<vcl::Window> aContentWindow, - const OUString& sTypeOfJSON) + JSDialogSender(const VclPtr<vcl::Window>& aNotifierWindow, + const VclPtr<vcl::Window>& aContentWindow, const OUString& sTypeOfJSON) : m_bCanClose(true) { initializeSender(aNotifierWindow, aContentWindow, sTypeOfJSON); @@ -59,10 +59,11 @@ public: virtual void sendFullUpdate(bool bForce = false); void sendClose(); - void sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce = false); - virtual void sendAction(VclPtr<vcl::Window> pWindow, + void sendUpdate(const VclPtr<vcl::Window>& pWindow, bool bForce = false); + virtual void sendAction(const VclPtr<vcl::Window>& pWindow, std::unique_ptr<jsdialog::ActionDataMap> pData); - virtual void sendPopup(VclPtr<vcl::Window> pWindow, OUString sParentId, OUString sCloseId); + virtual void sendPopup(const VclPtr<vcl::Window>& pWindow, const OUString& sParentId, + const OUString& sCloseId); virtual void sendMenu(const VclPtr<PopupMenu>& pMenu); virtual void sendClosePopup(vcl::LOKWindowId nWindowId); void flush() { mpIdleNotify->Invoke(); } diff --git a/vcl/jsdialog/jsdialogsender.cxx b/vcl/jsdialog/jsdialogsender.cxx index d63e8e38b8ed..fac9cf229013 100644 --- a/vcl/jsdialog/jsdialogsender.cxx +++ b/vcl/jsdialog/jsdialogsender.cxx @@ -46,7 +46,8 @@ void JSDialogNotifyIdle::send(const OString& sMsg) } template <class VclType> -void JSDialogNotifyIdle::sendMessage(jsdialog::MessageType eType, const VclPtr<VclType>& pTarget, +void JSDialogNotifyIdle::sendMessage(const jsdialog::MessageType eType, + const VclPtr<VclType>& pTarget, std::unique_ptr<jsdialog::ActionDataMap> pData) { std::scoped_lock aGuard(m_aQueueMutex); @@ -94,7 +95,7 @@ OString JSDialogNotifyIdle::generateFullUpdate() const return aJsonWriter.finishAndGetAsOString(); } -OString JSDialogNotifyIdle::generateWidgetUpdate(VclPtr<vcl::Window> pWindow) const +OString JSDialogNotifyIdle::generateWidgetUpdate(const VclPtr<vcl::Window>& pWindow) const { if (!pWindow || !m_aNotifierWindow) return OString(); @@ -125,7 +126,7 @@ OString JSDialogNotifyIdle::generateCloseMessage() const } OString -JSDialogNotifyIdle::generateActionMessage(VclPtr<vcl::Window> pWindow, +JSDialogNotifyIdle::generateActionMessage(const VclPtr<vcl::Window>& pWindow, std::unique_ptr<jsdialog::ActionDataMap> pData) const { tools::JsonWriter aJsonWriter; @@ -146,7 +147,7 @@ JSDialogNotifyIdle::generateActionMessage(VclPtr<vcl::Window> pWindow, return aJsonWriter.finishAndGetAsOString(); } -OString JSDialogNotifyIdle::generatePopupMessage(VclPtr<vcl::Window> pWindow, +OString JSDialogNotifyIdle::generatePopupMessage(const VclPtr<vcl::Window>& pWindow, const OUString& sParentId, const OUString& sCloseId) const { @@ -323,7 +324,7 @@ void JSDialogSender::sendClose() flush(); } -void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce) +void JSDialogSender::sendUpdate(const VclPtr<vcl::Window>& pWindow, bool bForce) { if (!mpIdleNotify) return; @@ -335,7 +336,7 @@ void JSDialogSender::sendUpdate(VclPtr<vcl::Window> pWindow, bool bForce) mpIdleNotify->Start(); } -void JSDialogSender::sendAction(VclPtr<vcl::Window> pWindow, +void JSDialogSender::sendAction(const VclPtr<vcl::Window>& pWindow, std::unique_ptr<jsdialog::ActionDataMap> pData) { if (!mpIdleNotify) @@ -345,7 +346,8 @@ void JSDialogSender::sendAction(VclPtr<vcl::Window> pWindow, mpIdleNotify->Start(); } -void JSDialogSender::sendPopup(VclPtr<vcl::Window> pWindow, OUString sParentId, OUString sCloseId) +void JSDialogSender::sendPopup(const VclPtr<vcl::Window>& pWindow, const OUString& sParentId, + const OUString& sCloseId) { if (!mpIdleNotify) return; |