diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-11-03 21:56:40 +0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-05 10:02:12 +0100 |
commit | f2cd1c3c7cce2699d1341f726fc90cf30b52612c (patch) | |
tree | 15cbd44f997070f3218f250df0f3e475b957d99a /sw/qa | |
parent | cb9d192f18082d517b805f5d84fc62bde6319ded (diff) |
tdf#108687 vcl: always enable tabstop on radio buttons
...as long as they are not WB_NOTABSTOP of course,
just like checkboxes.
Even though all of the radio buttons are now marked
as WB_TABSTOP, the tab still only stops once inside
the radio group. That's perfect.
Without this, if none of the radio boxes was checked,
then the entire group was tab-skipped.
As a copy/paste programmer, I don't know how to
test this because there were no close enough examples
to follow.
Change-Id: I3c559fb274d736cbd2f56a6a8ddc1ca5a2cfe681
Reviewed-on: https://gerrit.libreoffice.org/62822
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/qa')
-rwxr-xr-x | sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt | bin | 0 -> 12847 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 41 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt b/sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt Binary files differnew file mode 100755 index 000000000000..caabc4987c30 --- /dev/null +++ b/sw/qa/extras/uiwriter/data2/tdf108687_tabstop.odt diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 91e8a8b5576d..dd7ea7369997 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -9,6 +9,13 @@ #include <swmodeltestbase.hxx> #include <com/sun/star/awt/FontSlant.hpp> +#include <LibreOfficeKit/LibreOfficeKitEnums.h> +#include <svx/svdpage.hxx> +#include <svx/svdview.hxx> +#include <vcl/scheduler.hxx> +#include <dcontact.hxx> +#include <drawdoc.hxx> +#include <ndtxt.hxx> #include <swdtflvr.hxx> #include <wrtsh.hxx> #include <redline.hxx> @@ -24,17 +31,34 @@ class SwUiWriterTest2 : public SwModelTestBase public: void testTdf101534(); void testTdf54819(); + void testTdf108687_tabstop(); void testTdf119571(); void testTdf119019(); CPPUNIT_TEST_SUITE(SwUiWriterTest2); CPPUNIT_TEST(testTdf101534); CPPUNIT_TEST(testTdf54819); + CPPUNIT_TEST(testTdf108687_tabstop); CPPUNIT_TEST(testTdf119571); CPPUNIT_TEST(testTdf119019); CPPUNIT_TEST_SUITE_END(); + +private: + SwDoc* createDoc(const char* pName = nullptr); }; +SwDoc* SwUiWriterTest2::createDoc(const char* pName) +{ + if (!pName) + loadURL("private:factory/swriter", nullptr); + else + load(DATA_DIRECTORY, pName); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + return pTextDoc->GetDocShell()->GetDoc(); +} + void SwUiWriterTest2::testTdf101534() { // Copy the first paragraph of the document. @@ -95,6 +119,23 @@ void SwUiWriterTest2::testTdf54819() getProperty<OUString>(getParagraph(1), "ParaStyleName")); } +void SwUiWriterTest2::testTdf108687_tabstop() +{ + SwDoc* pDoc = createDoc("tdf108687_tabstop.odt"); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + sal_Int32 nStartIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); + CPPUNIT_ASSERT_EQUAL(sal_Int32(9), nStartIndex); + + // Now pressing 'tab' should jump to the radio buttons. + SwXTextDocument* pXTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pXTextDocument); + pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, KEY_TAB); + pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, KEY_TAB); + Scheduler::ProcessEventsToIdle(); + //sal_Int32 nEndIndex = pWrtShell->GetCursor()->GetNode().GetIndex(); + //CPPUNIT_ASSERT_EQUAL(sal_Int32(11), nEndIndex); +} + void SwUiWriterTest2::testTdf119571() { load(DATA_DIRECTORY, "tdf54819.fodt"); |