diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-07-17 14:03:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-07-17 14:11:05 +0100 |
commit | f8f05d43de8728db58c8224c8aebf31ff570b6fc (patch) | |
tree | 350661fcc9ac7ede6c97baa56d39fcca7e1b0721 /i18npool/qa | |
parent | for external modules add a dependency on the makefile.mk itself (diff) | |
download | core-f8f05d43de8728db58c8224c8aebf31ff570b6fc.tar.gz core-f8f05d43de8728db58c8224c8aebf31ff570b6fc.zip |
Resolves: fdo49629 GotoEndOfWord fails with footnote at word end
a) remove special handling of 0x0002 in our custom icu rules.
Which brings us a step closer to getting rid of at least
some of them in favour of the defaults
b) expand the 0x02 in SwTxtNode::BuildConversionMap like we
do for fields so
Good side effect is our word count and character count now take into account
the actual footnote indicator text, as does our cursor travelling. Both of
which are more word-alike.
Change-Id: I3b0024ac4b10934bee7a9e83b0fce08a18556c7b
Diffstat (limited to 'i18npool/qa')
-rw-r--r-- | i18npool/qa/cppunit/test_breakiterator.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 3c2ba50b8712..3ed44fcb9ff5 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -125,6 +125,39 @@ void TestBreakIterator::testLineBreaking() CPPUNIT_ASSERT_MESSAGE("Expected a break at the the start of the word", aResult.breakIndex == aWord.getLength()+1); } } + + //See https://bugs.freedesktop.org/show_bug.cgi?id=49629 + for (int mode = i18n::WordType::ANY_WORD; mode <= i18n::WordType::WORD_COUNT; ++mode) + { + //make sure that in all cases isBeginWord and isEndWord matches getWordBoundary + // + //test "Word", then "Word\x01" then "Word\x02" + for (sal_Unicode i = 0; i < 3; ++i) + { + ::rtl::OUString aTest("Word"); + if (i > 0) + aTest += rtl::OUString(i) + rtl::OUString("Word"); + i18n::Boundary aBounds = m_xBreak->getWordBoundary(aTest, 0, aLocale, mode, true); + switch (mode) + { + case i18n::WordType::ANY_WORD: + CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4); + break; + case i18n::WordType::ANYWORD_IGNOREWHITESPACES: + CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4); + break; + case i18n::WordType::DICTIONARY_WORD: + CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4); + break; + case i18n::WordType::WORD_COUNT: + CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 4); + break; + } + + CPPUNIT_ASSERT(m_xBreak->isBeginWord(aTest, aBounds.startPos, aLocale, mode)); + CPPUNIT_ASSERT(m_xBreak->isEndWord(aTest, aBounds.endPos, aLocale, mode)); + } + } } //See https://bugs.freedesktop.org/show_bug.cgi?id=49629 |