diff options
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/qa/unit/core-test.cxx | 15 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 4 |
2 files changed, 17 insertions, 2 deletions
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx index 8becb860cc0b..c23e94a0f60f 100644 --- a/editeng/qa/unit/core-test.cxx +++ b/editeng/qa/unit/core-test.cxx @@ -89,6 +89,8 @@ public: void testLargeParaCopyPaste(); + void testTransliterate(); + DECL_STATIC_LINK( Test, CalcFieldValueHdl, EditFieldInfo*, void ); CPPUNIT_TEST_SUITE(Test); @@ -107,6 +109,7 @@ public: CPPUNIT_TEST(testParaStartCopyPaste); CPPUNIT_TEST(testSectionAttributes); CPPUNIT_TEST(testLargeParaCopyPaste); + CPPUNIT_TEST(testTransliterate); CPPUNIT_TEST_SUITE_END(); private: @@ -1741,6 +1744,18 @@ void Test::testLargeParaCopyPaste() CPPUNIT_ASSERT_EQUAL( aTenthPara, rDoc.GetParaAsString(sal_Int32(11)) ); } +void Test::testTransliterate() +{ + // Create EditEngine's instance + EditEngine aEditEngine( mpItemPool ); + + OUString sText("one (two) three"); + aEditEngine.SetText(sText); + aEditEngine.TransliterateText(ESelection(0, 0, 0, sText.getLength()), TransliterationFlags::TITLE_CASE); + OUString aExpected("One (Two) Three"); + CPPUNIT_ASSERT_EQUAL(aExpected, aEditEngine.GetText()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index f315141e9719..1114fee47b9a 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2791,8 +2791,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, (void) aSelTxt; #endif - aCurWordBndry = _xBI->nextWord(aNodeStr, nCurrentEnd, - GetLocale( EditPaM( pNode, nCurrentEnd + 1 ) ), + aCurWordBndry = _xBI->nextWord(aNodeStr, nCurrentStart, + GetLocale( EditPaM( pNode, nCurrentStart + 1 ) ), nWordType); } DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos, "failed to reach end of transliteration" ); |