summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-03-27 23:38:13 +0300
committerTor Lillqvist <tml@collabora.com>2017-03-28 00:00:17 +0300
commitc0b5e7ec7112f228b31389a4a3cc9b40d7c181cb (patch)
tree67e462f0e816c49afebddd156fcba026b4bba3eb /libreofficekit
parentf900888ba51803d924bb5129978aa891879ecc59 (diff)
Use symbolic names for keys from css::awt::Key
Change-Id: Iee2f4540cddeb05fcf0ae2ecadf7de8fbb4e3a0d
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk4
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx26
2 files changed, 18 insertions, 12 deletions
diff --git a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
index 5b1727efbe98..ead598f965e5 100644
--- a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
+++ b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
@@ -33,6 +33,10 @@ $(eval $(call gb_CppunitTest_add_libs,libreofficekit_tiledrendering,\
))
endif
+$(eval $(call gb_CppunitTest_use_api,libreofficekit_tiledrendering,\
+ offapi \
+))
+
$(eval $(call gb_CppunitTest_use_configuration,libreofficekit_tiledrendering))
# vim: set noet sw=4 ts=4:
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index a4e84ee8d122..a805121992e5 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -19,6 +19,8 @@
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
+#include <com/sun/star/awt/Key.hpp>
+
#if defined __clang__ && defined __linux__
#include <cxxabi.h>
#include <config_options.h>
@@ -263,16 +265,16 @@ void TiledRenderingTest::testDocumentLoadLanguage(Office* pOffice)
// assert that '.' is the decimal separator
insertString(*pDocument, "1.5");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1027); // right arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1027);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RIGHT);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RIGHT);
processEventsToIdle();
insertString(*pDocument, "=2*A1");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1280); // enter
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1280);
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1025); // up arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1025);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::UP);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::UP);
processEventsToIdle();
// we've got a meaningful result
@@ -290,16 +292,16 @@ void TiledRenderingTest::testDocumentLoadLanguage(Office* pOffice)
// with cs-CZ, the decimal separator is ',' instead, assert that
insertString(*pDocument, "1,5");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1027); // right arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1027);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RIGHT);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RIGHT);
processEventsToIdle();
insertString(*pDocument, "=2*A1");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1280); // enter
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1280);
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1025); // up arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1025);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::UP);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::UP);
processEventsToIdle();
// we've got a meaningful result