Use symbolic names for keys from css::awt::Key

Change-Id: Iee2f4540cddeb05fcf0ae2ecadf7de8fbb4e3a0d
This commit is contained in:
Tor Lillqvist 2017-03-27 23:38:13 +03:00
parent f900888ba5
commit c0b5e7ec71
2 changed files with 18 additions and 12 deletions

View file

@ -33,6 +33,10 @@ $(eval $(call gb_CppunitTest_add_libs,libreofficekit_tiledrendering,\
)) ))
endif endif
$(eval $(call gb_CppunitTest_use_api,libreofficekit_tiledrendering,\
offapi \
))
$(eval $(call gb_CppunitTest_use_configuration,libreofficekit_tiledrendering)) $(eval $(call gb_CppunitTest_use_configuration,libreofficekit_tiledrendering))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:

View file

@ -19,6 +19,8 @@
#include <osl/file.hxx> #include <osl/file.hxx>
#include <rtl/bootstrap.hxx> #include <rtl/bootstrap.hxx>
#include <com/sun/star/awt/Key.hpp>
#if defined __clang__ && defined __linux__ #if defined __clang__ && defined __linux__
#include <cxxabi.h> #include <cxxabi.h>
#include <config_options.h> #include <config_options.h>
@ -263,16 +265,16 @@ void TiledRenderingTest::testDocumentLoadLanguage(Office* pOffice)
// assert that '.' is the decimal separator // assert that '.' is the decimal separator
insertString(*pDocument, "1.5"); insertString(*pDocument, "1.5");
pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1027); // right arrow pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RIGHT);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1027); pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RIGHT);
processEventsToIdle(); processEventsToIdle();
insertString(*pDocument, "=2*A1"); insertString(*pDocument, "=2*A1");
pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1280); // enter pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RETURN);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1280); pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RETURN);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1025); // up arrow pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::UP);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1025); pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::UP);
processEventsToIdle(); processEventsToIdle();
// we've got a meaningful result // 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 // with cs-CZ, the decimal separator is ',' instead, assert that
insertString(*pDocument, "1,5"); insertString(*pDocument, "1,5");
pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1027); // right arrow pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RIGHT);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1027); pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RIGHT);
processEventsToIdle(); processEventsToIdle();
insertString(*pDocument, "=2*A1"); insertString(*pDocument, "=2*A1");
pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1280); // enter pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RETURN);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1280); pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RETURN);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1025); // up arrow pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::UP);
pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1025); pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::UP);
processEventsToIdle(); processEventsToIdle();
// we've got a meaningful result // we've got a meaningful result