diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-10-21 12:20:52 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-10-22 15:53:34 +0200 |
commit | 31b1e23e2d806f847fce21b8827f015384f20916 (patch) | |
tree | 51e703c3098cfa9e1540b7641493866bb95eb80b | |
parent | a21c6a3dd36aee21bf1536183dc8ccde2ff52672 (diff) |
better name for a function overload
It's better to add to the name what the overload does rather than
just have a "mysterious" extra int.
Change-Id: Iff89679c4a978a4596ac662ef74e934cdefefc9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124001
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | desktop/inc/lib/init.hxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 2 | ||||
-rw-r--r-- | include/editeng/outliner.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/lokcallback.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/viewsh.hxx | 2 | ||||
-rw-r--r-- | include/test/lokcallback.hxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 6 | ||||
-rw-r--r-- | test/source/lokcallback.cxx | 4 |
9 files changed, 18 insertions, 16 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 9f15377ba0ec..bc090fc208a9 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -102,7 +102,7 @@ namespace desktop { // SfxLockCallbackInterface virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) override; - virtual void libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) override; + virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) override; virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart) override; private: diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 3720ed54fbbf..6c6c2ae64f91 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1475,7 +1475,7 @@ void CallbackFlushHandler::libreOfficeKitViewCallback(int nType, const char* pPa queue(nType, callbackData); } -void CallbackFlushHandler::libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) +void CallbackFlushHandler::libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) { CallbackData callbackData(pPayload, nViewId); queue(nType, callbackData); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index d962f72485dc..c269bf49046f 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -364,7 +364,7 @@ class SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI OutlinerViewShell { public: virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) const = 0; - virtual void libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) const = 0; + virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) const = 0; virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart) const = 0; virtual ViewShellId GetViewShellId() const = 0; virtual ViewShellDocId GetDocId() const = 0; diff --git a/include/sfx2/lokcallback.hxx b/include/sfx2/lokcallback.hxx index 4c40c5452c15..d01e7203205e 100644 --- a/include/sfx2/lokcallback.hxx +++ b/include/sfx2/lokcallback.hxx @@ -30,7 +30,8 @@ public: // LibreOfficeKitCallback equivalent. virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) = 0; // Callback that explicitly provides view id (which is also included in the payload). - virtual void libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) = 0; + virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) + = 0; // LOK_CALLBACK_INVALIDATE_TILES // nPart is either part, -1 for all-parts, or INT_MIN if // comphelper::LibreOfficeKit::isPartInInvalidation() is not set diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 886ca34cdf44..29cf9b756ad7 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -339,7 +339,7 @@ public: void setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallback); /// Invokes the registered callback, if there are any. virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) const override; - virtual void libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) const override; + virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) const override; virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart) const override; // Performs any pending calls to libreOfficeKitViewInvalidateTilesCallback() as necessary. virtual void flushPendingLOKInvalidateTiles(); diff --git a/include/test/lokcallback.hxx b/include/test/lokcallback.hxx index 988ce7688e93..f7a619f68cb3 100644 --- a/include/test/lokcallback.hxx +++ b/include/test/lokcallback.hxx @@ -26,7 +26,8 @@ class OOO_DLLPUBLIC_TEST TestLokCallbackWrapper : public SfxLokCallbackInterface public: TestLokCallbackWrapper(LibreOfficeKitCallback callback, void* data); virtual void libreOfficeKitViewCallback(int nType, const char* pPayload) override; - virtual void libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) override; + virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, + int nViewId) override; virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle* pRect, int nPart) override; diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index bfb55c10eff1..beafa3fa437c 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -375,7 +375,7 @@ void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell c const OString aPayload = lcl_generateJSON(pThisView, rKey, rPayload); const int viewId = SfxLokHelper::getView(pThisView); - pOtherView->libreOfficeKitViewCallback(nType, aPayload.getStr(), viewId); + pOtherView->libreOfficeKitViewCallbackWithViewId(nType, aPayload.getStr(), viewId); } void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell const* pOtherView, @@ -386,7 +386,7 @@ void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell c return; const int viewId = SfxLokHelper::getView(pThisView); - pOtherView->libreOfficeKitViewCallback(nType, lcl_generateJSON(pThisView, rTree).getStr(), viewId); + pOtherView->libreOfficeKitViewCallbackWithViewId(nType, lcl_generateJSON(pThisView, rTree).getStr(), viewId); } void SfxLokHelper::notifyOtherViews(const SfxViewShell* pThisView, int nType, std::string_view rKey, @@ -413,7 +413,7 @@ void SfxLokHelper::notifyOtherViews(const SfxViewShell* pThisView, int nType, st viewId = SfxLokHelper::getView(pThisView); } - pViewShell->libreOfficeKitViewCallback(nType, aPayload.getStr(), viewId); + pViewShell->libreOfficeKitViewCallbackWithViewId(nType, aPayload.getStr(), viewId); } pViewShell = SfxViewShell::GetNext(*pViewShell); @@ -444,7 +444,7 @@ void SfxLokHelper::notifyOtherViews(const SfxViewShell* pThisView, int nType, viewId = SfxLokHelper::getView(pThisView); } - pViewShell->libreOfficeKitViewCallback(nType, aPayload.getStr(), viewId); + pViewShell->libreOfficeKitViewCallbackWithViewId(nType, aPayload.getStr(), viewId); } pViewShell = SfxViewShell::GetNext(*pViewShell); @@ -578,7 +578,7 @@ void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* pThisVie "\", \"mispelledWord\": \"" + OString::number(bMispelledWord ? 1 : 0) + "\", \"hyperlink\": " + sHyperlink + " }"; const int viewId = SfxLokHelper::getView(); - pThisView->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sPayload.getStr(), viewId); + pThisView->libreOfficeKitViewCallbackWithViewId(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sPayload.getStr(), viewId); } else { diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 2b78cde00386..2d21ee8b0909 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1498,16 +1498,16 @@ void SfxViewShell::libreOfficeKitViewInvalidateTilesCallback(const tools::Rectan "SfxViewShell::libreOfficeKitViewInvalidateTilesCallback no callback set!"); } -void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload, int nViewId) const +void SfxViewShell::libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, int nViewId) const { if (ignoreLibreOfficeKitViewCallback(nType, pImpl.get())) return; if (pImpl->m_pLibreOfficeKitViewCallback) - pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewCallback(nType, pPayload, nViewId); + pImpl->m_pLibreOfficeKitViewCallback->libreOfficeKitViewCallbackWithViewId(nType, pPayload, nViewId); else SAL_INFO( "sfx.view", - "SfxViewShell::libreOfficeKitViewCallback no callback set! Dropped payload of type " + "SfxViewShell::libreOfficeKitViewCallbackWithViewId no callback set! Dropped payload of type " << lokCallbackTypeToString(nType) << ": [" << pPayload << ']'); } diff --git a/test/source/lokcallback.cxx b/test/source/lokcallback.cxx index 912fe2d8c807..389219192a50 100644 --- a/test/source/lokcallback.cxx +++ b/test/source/lokcallback.cxx @@ -30,8 +30,8 @@ void TestLokCallbackWrapper::libreOfficeKitViewCallback(int nType, const char* p callCallback(nType, pPayload); } -void TestLokCallbackWrapper::libreOfficeKitViewCallback(int nType, const char* pPayload, - int /*nViewId*/) +void TestLokCallbackWrapper::libreOfficeKitViewCallbackWithViewId(int nType, const char* pPayload, + int /*nViewId*/) { callCallback(nType, pPayload); // the view id is also included in payload } |