sw: emit LOK_CALLBACK_VIEW_CURSOR_VISIBLE as part of registerCallback()
Have a graphic selection (and thus a hidden text cursor) in the first view, create a second view. The view text cursors should be hidden in the second view as well. Change-Id: Ic22db84aab62c8f43c2da3d4a19b56c993c9f012 Reviewed-on: https://gerrit.libreoffice.org/28836 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
@@ -1296,6 +1296,14 @@ void SwTiledRenderingTest::testCreateViewGraphicSelection()
|
|||||||
// first one.
|
// first one.
|
||||||
CPPUNIT_ASSERT(aView1.m_bGraphicSelection);
|
CPPUNIT_ASSERT(aView1.m_bGraphicSelection);
|
||||||
|
|
||||||
|
// Make sure that the hidden text cursor isn't visible in the second view, either.
|
||||||
|
ViewCallback aView2;
|
||||||
|
aView2.m_bViewCursorVisible = true;
|
||||||
|
SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
|
||||||
|
// This was true, the second view didn't get the visibility of the text
|
||||||
|
// cursor of the first view.
|
||||||
|
CPPUNIT_ASSERT(!aView2.m_bViewCursorVisible);
|
||||||
|
|
||||||
mxComponent->dispose();
|
mxComponent->dispose();
|
||||||
mxComponent.clear();
|
mxComponent.clear();
|
||||||
comphelper::LibreOfficeKit::setActive(false);
|
comphelper::LibreOfficeKit::setActive(false);
|
||||||
|
@@ -204,7 +204,10 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell* pViewShell)
|
|||||||
if (pViewShell == m_pCursorShell->GetSfxViewShell())
|
if (pViewShell == m_pCursorShell->GetSfxViewShell())
|
||||||
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
|
pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr());
|
||||||
else
|
else
|
||||||
|
{
|
||||||
SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
|
SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
|
||||||
|
SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", OString::boolean(m_bIsVisible));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user