summaryrefslogtreecommitdiff
path: root/sc/qa/unit/tiledrendering/tiledrendering.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit/tiledrendering/tiledrendering.cxx')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 711d663b5892..adca0bf2cf7e 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -37,6 +37,7 @@
#include <vcl/scheduler.hxx>
#include <vcl/vclevent.hxx>
#include <sc.hrc>
+#include <comphelper/string.hxx>
#include <chrono>
#include <cstddef>
@@ -96,6 +97,7 @@ public:
void testIMESupport();
void testFilterDlg();
void testVbaRangeCopyPaste();
+ void testPageDownInvalidation();
CPPUNIT_TEST_SUITE(ScTiledRenderingTest);
CPPUNIT_TEST(testRowColumnSelections);
@@ -129,6 +131,7 @@ public:
CPPUNIT_TEST(testIMESupport);
CPPUNIT_TEST(testFilterDlg);
CPPUNIT_TEST(testVbaRangeCopyPaste);
+ CPPUNIT_TEST(testPageDownInvalidation);
CPPUNIT_TEST_SUITE_END();
private:
@@ -432,6 +435,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;
@@ -499,6 +503,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;
}
}
@@ -1673,6 +1686,31 @@ void ScTiledRenderingTest::testVbaRangeCopyPaste()
comphelper::LibreOfficeKit::setActive(false);
}
+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);
+
+ comphelper::LibreOfficeKit::setActive(false);
+}
+
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScTiledRenderingTest);