[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sw/qa

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Tue May 14 12:45:29 UTC 2019


 sw/qa/extras/tiledrendering/tiledrendering.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 7065bc6014636ea5abb2373b82e1dd02140a387e
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue May 14 14:36:24 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue May 14 08:44:45 2019 -0400

    CppunitTest_sw_tiledrendering: avoid stack-use-after-return in ...
    
    .. testViewCursors()
    
    This is a good idea in general, but it's in preparation of enabling the
    sidebar by default during tiled rendering.
    
    Change-Id: Ib9e7dcd72458a4126404b78bbdb6678b10d15ce3

diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index b7c0a03bee3d..e68ec068d3bc 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -929,7 +929,9 @@ void SwTiledRenderingTest::testViewCursors()
     SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
     ViewCallback aView1;
     SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1);
+    int nView1 = SfxLokHelper::getView();
     SfxLokHelper::createView();
+    int nView2 = SfxLokHelper::getView();
     ViewCallback aView2;
     SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView2);
     CPPUNIT_ASSERT(aView1.m_bOwnCursorInvalidated);
@@ -959,6 +961,11 @@ void SwTiledRenderingTest::testViewCursors()
     CPPUNIT_ASSERT(aView1.m_bViewSelectionSet);
     CPPUNIT_ASSERT(aView2.m_bOwnSelectionSet);
     CPPUNIT_ASSERT(!aView2.m_bViewSelectionSet);
+
+    SfxLokHelper::setView(nView1);
+    SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
+    SfxLokHelper::setView(nView2);
+    SfxViewShell::Current()->registerLibreOfficeKitViewCallback(nullptr, nullptr);
 }
 
 void SwTiledRenderingTest::testShapeViewCursors()


More information about the Libreoffice-commits mailing list