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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 26 14:32:13 UTC 2019


 sc/qa/unit/tiledrendering/tiledrendering.cxx |   36 +++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

New commits:
commit e5eb71cdd13ffdd74458cc743eee984db80bed82
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Fri Sep 13 15:59:54 2019 +0200
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Sep 26 16:31:21 2019 +0200

    sc lok: Test invalidation triggered by PageDown
    
    Reviewed-on: https://gerrit.libreoffice.org/79487
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 54bb961b1e8c01603782f8e5c50e9e1ee5896d7c)
    
    Change-Id: Id54a679b60e440f17371a3a532928bd161077e90
    Reviewed-on: https://gerrit.libreoffice.org/79613
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index c23525adbd59..9af250ddca16 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -41,6 +41,7 @@
 #include <vcl/virdev.hxx>
 #include <vcl/unohelp2.hxx>
 #include <sc.hrc>
+#include <comphelper/string.hxx>
 
 #include <chrono>
 #include <cstddef>
@@ -101,6 +102,7 @@ public:
     void testIMESupport();
     void testFilterDlg();
     void testVbaRangeCopyPaste();
+    void testPageDownInvalidation();
 
     CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
     CPPUNIT_TEST(testRowColumnSelections);
@@ -134,6 +136,7 @@ public:
     CPPUNIT_TEST(testIMESupport);
     CPPUNIT_TEST(testFilterDlg);
     CPPUNIT_TEST(testVbaRangeCopyPaste);
+    CPPUNIT_TEST(testPageDownInvalidation);
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -439,6 +442,7 @@ public:
     bool m_bGraphicViewSelection;
     bool m_bFullInvalidateTiles;
     bool m_bInvalidateTiles;
+    tools::Rectangle m_aInvalidation;
     bool m_bViewLock;
     OString m_sCellFormula;
     boost::property_tree::ptree m_aCommentCallbackResult;
@@ -506,6 +510,15 @@ public:
             }
             else
             {
+                if (m_aInvalidation.IsEmpty())
+                {
+                    uno::Sequence<OUString> aSeq = comphelper::string::convertCommaSeparated(OUString::createFromAscii(pPayload));
+                    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), aSeq.getLength());
+                    m_aInvalidation.setX(aSeq[0].toInt32());
+                    m_aInvalidation.setY(aSeq[1].toInt32());
+                    m_aInvalidation.setWidth(aSeq[2].toInt32());
+                    m_aInvalidation.setHeight(aSeq[3].toInt32());
+                }
                 m_bInvalidateTiles = true;
             }
         }
@@ -1675,6 +1688,29 @@ void ScTiledRenderingTest::testVbaRangeCopyPaste()
     CPPUNIT_ASSERT(!pDocShell->GetClipData().is());
 }
 
+void ScTiledRenderingTest::testPageDownInvalidation()
+{
+    comphelper::LibreOfficeKit::setActive();
+
+    ScModelObj* pModelObj = createDoc("empty.ods");
+    ScViewData* pViewData = ScDocShell::GetViewData();
+    CPPUNIT_ASSERT(pViewData);
+
+    int nView1 = SfxLokHelper::getView();
+    ViewCallback aView1;
+    SfxViewShell::Current()->registerLibreOfficeKitViewCallback(&ViewCallback::callback, &aView1);
+    CPPUNIT_ASSERT(!lcl_hasEditView(*pViewData));
+
+    SfxLokHelper::setView(nView1);
+    aView1.m_bInvalidateTiles = false;
+    aView1.m_aInvalidation = tools::Rectangle();
+    pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, awt::Key::PAGEDOWN, 0);
+    pModelObj->postKeyEvent(LOK_KEYEVENT_KEYUP, awt::Key::PAGEDOWN, 0);
+    Scheduler::ProcessEventsToIdle();
+    CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
+    CPPUNIT_ASSERT_EQUAL(tools::Rectangle(15, 15, 1230, 225), aView1.m_aInvalidation);
+}
+
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);


More information about the Libreoffice-commits mailing list