diff options
-rw-r--r-- | unotools/qa/unit/testGetEnlishSearchName.cxx | 25 | ||||
-rw-r--r-- | unotools/source/misc/fontdefs.cxx | 3 |
2 files changed, 6 insertions, 22 deletions
diff --git a/unotools/qa/unit/testGetEnlishSearchName.cxx b/unotools/qa/unit/testGetEnlishSearchName.cxx index 38b10eafb516..1701215987a0 100644 --- a/unotools/qa/unit/testGetEnlishSearchName.cxx +++ b/unotools/qa/unit/testGetEnlishSearchName.cxx @@ -15,10 +15,8 @@ #include "cppunit/plugin/TestPlugIn.h" #include <unotools/fontdefs.hxx> - class Test: public CppUnit::TestFixture { - public: virtual void setUp() SAL_OVERRIDE; void testSingleElement(); @@ -34,36 +32,23 @@ void Test::setUp() void Test::testSingleElement() { - { //lowercase - printf("GetEnglishSearchFontName( \"SYMBOL\" )"); + { // lowercase OUString test1 = GetEnglishSearchFontName( "SYMBOL" ); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); - printf("return %s",test1.getStr()); - //trailingWhitespaces - printf("GetEnglishSearchFontName( \"SYMBOL \" )"); + // trailingWhitespaces test1 = GetEnglishSearchFontName( "Symbol " ); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); - printf("return %s",test1.getStr()); - //removing Skripts - printf("GetEnglishSearchFontName( \"SYMBOL(skript)\" )"); + // removing Skripts test1 = GetEnglishSearchFontName( "Symbol(skript)" ); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); - printf("return %s",test1.getStr()); - //remove Whitespaces between - printf("GetEnglishSearchFontName( \"SYMBOL (skript)\" )"); + // remove Whitespaces between test1 = GetEnglishSearchFontName( "Symbol (skript)" ); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); - printf("return %s",test1.getStr()); - //trailingWhitespaces - + // trailingWhitespaces } - - } - - CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index be2079fe711a..4f0fb085634f 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -400,7 +400,6 @@ OUString GetEnglishSearchFontName( const OUString& rInName ) else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon { // Remove white spaces and special characters - rName.remove(i,1); nLen--; continue; @@ -426,7 +425,7 @@ OUString GetEnglishSearchFontName( const OUString& rInName ) FontNameDictionary::const_iterator it = aDictionary.find( rNameStr ); if( it != aDictionary.end() ) - rName = OUString::createFromAscii ( it->second ); + rNameStr = OUString::createFromAscii ( it->second ); } return rNameStr; |