Remove no longer needed SdrModel::libreOfficeKitCallback()

All former clients are changed to call
SfxViewShell::libreOfficeKitViewCallback() instead.

Change-Id: Ic5dcf0a8a4241338fcd6941f13ce438157676481
Reviewed-on: https://gerrit.libreoffice.org/26521
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index b0e4d56..709844d 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -143,7 +143,7 @@ public:

struct SdrModelImpl;

class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >, public OutlinerSearchable
class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >
{
protected:
    std::vector<SdrPage*> maMaPag;     // master pages
@@ -168,10 +168,6 @@ protected:
    SdrOutliner*    pChainingOutliner; // an Outliner for chaining overflowing text
    sal_uIntPtr           nDefTextHgt;    // Default text height in logical units
    VclPtr<OutputDevice>  pRefOutDev;     // ReferenceDevice for the EditEngine
    LibreOfficeKitCallback mpLibreOfficeKitCallback;
    void* mpLibreOfficeKitData;
    /// Set if we are in the middle of a tiled search.
    bool mbTiledSearching;
    sal_uIntPtr           nProgressAkt;   // for the
    sal_uIntPtr           nProgressMax;   // ProgressBar-
    sal_uIntPtr           nProgressOfs;   // -Handler
@@ -328,16 +324,6 @@ public:
    // ReferenceDevice for the EditEngine
    void                 SetRefDevice(OutputDevice* pDev);
    OutputDevice*        GetRefDevice() const                   { return pRefOutDev.get(); }
    /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API.
    void                 registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
    /// Gets the LOK data registered by registerLibreOfficeKitCallback().
    void*                getLibreOfficeKitData() const;
    /// Invokes the registered callback, if there are any.
    void                 libreOfficeKitCallback(int nType, const char* pPayload) const override;
    /// Set if we are doing tiled searching.
    void                 setTiledSearching(bool bTiledSearching);
    /// Are we doing tiled searching?
    bool                 isTiledSearching() const;
    // If a new MapMode is set on the RefDevice (or similar)
    void                 RefDeviceChanged(); // not yet implemented
    // default font height in logical units
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 95bb72d..12f8b5d 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3220,9 +3220,8 @@ bool ScDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPas
    return bRes;
}

void ScDocShell::libreOfficeKitCallback(int nType, const char* pPayload) const
void ScDocShell::libreOfficeKitCallback(int /*nType*/, const char* /*pPayload*/) const
{
    aDocument.GetDrawLayer()->libreOfficeKitCallback(nType, pPayload);
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ac0314a..2dfbc2c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -554,10 +554,8 @@ Size ScModelObj::getDocumentSize()
    return aSize;
}

void ScModelObj::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
void ScModelObj::registerCallback(LibreOfficeKitCallback /*pCallback*/, void* /*pData*/)
{
    SolarMutexGuard aGuard;
    pDocShell->GetDocument().GetDrawLayer()->registerLibreOfficeKitCallback(pCallback, pData);
}

void ScModelObj::postKeyEvent(int nType, int nCharCode, int nKeyCode)
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 65dafa0..b948bd9 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -478,10 +478,8 @@ void DrawDocShell::ClearUndoBuffer()
        pUndoManager->Clear();
}

void DrawDocShell::libreOfficeKitCallback(int nType, const char* pPayload) const
void DrawDocShell::libreOfficeKitCallback(int /*nType*/, const char* /*pPayload*/) const
{
    if (mpDoc)
        mpDoc->libreOfficeKitCallback(nType, pPayload);
}

} // end of namespace sd
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index e0f6dbf..ebc6103 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2415,10 +2415,8 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs
    SvtSaveOptions().SetWarnAlienFormat(false);
}

void SdXImpressDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
void SdXImpressDocument::registerCallback(LibreOfficeKitCallback /*pCallback*/, void* /*pData*/)
{
    SolarMutexGuard aGuard;
    mpDoc->registerLibreOfficeKitCallback(pCallback, pData);
}

void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 721a63a..ed9b0f7 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -126,9 +126,6 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
    pDrawOutliner=nullptr;
    pHitTestOutliner=nullptr;
    pRefOutDev=nullptr;
    mpLibreOfficeKitCallback = nullptr;
    mpLibreOfficeKitData = nullptr;
    mbTiledSearching = false;
    nProgressAkt=0;
    nProgressMax=0;
    nProgressOfs=0;
@@ -808,45 +805,6 @@ void SdrModel::SetRefDevice(OutputDevice* pDev)
    RefDeviceChanged();
}

void SdrModel::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData)
{
    mpLibreOfficeKitCallback = pCallback;
    mpLibreOfficeKitData = pData;
}

void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const
{
    if (mbTiledSearching)
    {
        switch (nType)
        {
        case LOK_CALLBACK_TEXT_SELECTION:
        case LOK_CALLBACK_TEXT_SELECTION_START:
        case LOK_CALLBACK_TEXT_SELECTION_END:
        case LOK_CALLBACK_GRAPHIC_SELECTION:
            return;
        }
    }

    if (mpLibreOfficeKitCallback)
        mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData);
}

void SdrModel::setTiledSearching(bool bTiledSearching)
{
    mbTiledSearching = bTiledSearching;
}

bool SdrModel::isTiledSearching() const
{
    return mbTiledSearching;
}

void* SdrModel::getLibreOfficeKitData() const
{
    return mpLibreOfficeKitData;
}

void SdrModel::ImpReformatAllTextObjects()
{
    if( isLocked() )
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index c014cbb..abeea02 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -571,11 +571,6 @@ public:
    virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; }
    bool IsSelectAll() { return mbSelectAll; }

    /// The actual implementation of the vcl::ITiledRenderable::registerCallback() API for Writer.
    void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
    /// Invokes the registered callback, if there are any.
    void libreOfficeKitCallback(int nType, const char* pPayload) const;

    void setOutputToWindow(bool bOutputToWindow);
    bool isOutputToWindow() const;

diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index f2cb6a1..0dd248d 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -115,18 +115,6 @@ void SwViewShell::ToggleHeaderFooterEdit()
    GetWin()->Invalidate();
}

void SwViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData)
{
    getIDocumentDrawModelAccess().GetDrawModel()->registerLibreOfficeKitCallback(pCallback, pData);
    if (SwPostItMgr* pPostItMgr = GetPostItMgr())
        pPostItMgr->registerLibreOfficeKitCallback(getIDocumentDrawModelAccess().GetDrawModel());
}

void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const
{
    getIDocumentDrawModelAccess().GetDrawModel()->libreOfficeKitCallback(nType, pPayload);
}

void SwViewShell::setOutputToWindow(bool bOutputToWindow)
{
    mbOutputToWindow = bOutputToWindow;
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 40d5233..fada17a 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1338,13 +1338,8 @@ bool SwDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPas
    return bRes;
}

void SwDocShell::libreOfficeKitCallback(int nType, const char* pPayload) const
void SwDocShell::libreOfficeKitCallback(int /*nType*/, const char* /*pPayload*/) const
{
    if (!m_pDoc)
        return;

    SwDrawModel* pDrawModel = m_pDoc->getIDocumentDrawModelAccess().GetDrawModel();
    pDrawModel->libreOfficeKitCallback(nType, pPayload);
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 3256047..5815ec0 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3299,13 +3299,8 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
    SvtSaveOptions().SetWarnAlienFormat(false);
}

void SwXTextDocument::registerCallback(LibreOfficeKitCallback pCallback, void* pData)
void SwXTextDocument::registerCallback(LibreOfficeKitCallback /*pCallback*/, void* /*pData*/)
{
    SolarMutexGuard aGuard;

    SwDoc* pDoc = pDocShell->GetDoc();
    SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
    pViewShell->registerLibreOfficeKitCallback(pCallback, pData);
}

void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)