diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 25 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 7 |
2 files changed, 31 insertions, 1 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 69cbc8b3d131..1d39838bfbf8 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -851,4 +851,29 @@ void SfxLokHelper::postMouseEventAsync(const VclPtr<vcl::Window> &xWindow, LokMo postEventAsync(pLOKEv); } +void SfxLokHelper::dumpState(rtl::OStringBuffer &rState) +{ + SfxViewShell* pShell = SfxViewShell::Current(); + sal_Int32 nDocId = pShell ? static_cast<sal_Int32>(pShell->GetDocId().get()) : -1; + + rState.append("\n\tDocId:\t"); + rState.append(nDocId); + + if (nDocId < 0) + return; + + rState.append("\n\tViewCount:\t"); + rState.append(static_cast<sal_Int32>(getViewsCount(nDocId))); + + const SfxViewShell* const pCurrentViewShell = SfxViewShell::Current(); + SfxViewShell* pViewShell = SfxViewShell::GetFirst(); + while (pViewShell) + { + if (pCurrentViewShell == nullptr || pViewShell->GetDocId() == pCurrentViewShell-> GetDocId()) + pViewShell->dumpLibreOfficeKitViewState(rState); + + pViewShell = SfxViewShell::GetNext(*pViewShell); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index c14b31ce9862..d1f326c68b7f 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1418,7 +1418,6 @@ bool SfxViewShell::ExecKey_Impl(const KeyEvent& aKey) void SfxViewShell::setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallback) { - pImpl->m_pLibreOfficeKitViewCallback = nullptr; pImpl->m_pLibreOfficeKitViewCallback = pCallback; afterCallbackRegistered(); @@ -1436,6 +1435,12 @@ void SfxViewShell::setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallb } } +void SfxViewShell::dumpLibreOfficeKitViewState(rtl::OStringBuffer &rState) +{ + if (pImpl->m_pLibreOfficeKitViewCallback) + pImpl->m_pLibreOfficeKitViewCallback->dumpState(rState); +} + static bool ignoreLibreOfficeKitViewCallback(int nType, const SfxViewShell_Impl* pImpl) { if (!comphelper::LibreOfficeKit::isActive()) |