Kaydet (Commit) 1f7e6bdd authored tarafından Michael Meeks's avatar Michael Meeks

fdo#82854 - cleanup & review bits.

Change-Id: Ia5b2628adb62013a22cf6c5e384154c54abc2294
üst 8e1a7034
...@@ -15,10 +15,8 @@ ...@@ -15,10 +15,8 @@
#include "cppunit/plugin/TestPlugIn.h" #include "cppunit/plugin/TestPlugIn.h"
#include <unotools/fontdefs.hxx> #include <unotools/fontdefs.hxx>
class Test: public CppUnit::TestFixture class Test: public CppUnit::TestFixture
{ {
public: public:
virtual void setUp() SAL_OVERRIDE; virtual void setUp() SAL_OVERRIDE;
void testSingleElement(); void testSingleElement();
...@@ -34,36 +32,23 @@ void Test::setUp() ...@@ -34,36 +32,23 @@ void Test::setUp()
void Test::testSingleElement() void Test::testSingleElement()
{ {
{ //lowercase { // lowercase
printf("GetEnglishSearchFontName( \"SYMBOL\" )");
OUString test1 = GetEnglishSearchFontName( "SYMBOL" ); OUString test1 = GetEnglishSearchFontName( "SYMBOL" );
CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol"));
printf("return %s",test1.getStr()); // trailingWhitespaces
//trailingWhitespaces
printf("GetEnglishSearchFontName( \"SYMBOL \" )");
test1 = GetEnglishSearchFontName( "Symbol " ); test1 = GetEnglishSearchFontName( "Symbol " );
CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol"));
printf("return %s",test1.getStr()); // removing Skripts
//removing Skripts
printf("GetEnglishSearchFontName( \"SYMBOL(skript)\" )");
test1 = GetEnglishSearchFontName( "Symbol(skript)" ); test1 = GetEnglishSearchFontName( "Symbol(skript)" );
CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol"));
printf("return %s",test1.getStr()); // remove Whitespaces between
//remove Whitespaces between
printf("GetEnglishSearchFontName( \"SYMBOL (skript)\" )");
test1 = GetEnglishSearchFontName( "Symbol (skript)" ); test1 = GetEnglishSearchFontName( "Symbol (skript)" );
CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol")); CPPUNIT_ASSERT_EQUAL(test1, OUString("symbol"));
printf("return %s",test1.getStr()); // trailingWhitespaces
//trailingWhitespaces
} }
} }
CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -400,7 +400,6 @@ OUString GetEnglishSearchFontName( const OUString& rInName ) ...@@ -400,7 +400,6 @@ OUString GetEnglishSearchFontName( const OUString& rInName )
else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon else if( ((c < '0') || (c > '9')) && (c != ';') ) // not 0-9 or semicolon
{ {
// Remove white spaces and special characters // Remove white spaces and special characters
rName.remove(i,1); rName.remove(i,1);
nLen--; nLen--;
continue; continue;
...@@ -426,7 +425,7 @@ OUString GetEnglishSearchFontName( const OUString& rInName ) ...@@ -426,7 +425,7 @@ OUString GetEnglishSearchFontName( const OUString& rInName )
FontNameDictionary::const_iterator it = aDictionary.find( rNameStr ); FontNameDictionary::const_iterator it = aDictionary.find( rNameStr );
if( it != aDictionary.end() ) if( it != aDictionary.end() )
rName = OUString::createFromAscii ( it->second ); rNameStr = OUString::createFromAscii ( it->second );
} }
return rNameStr; return rNameStr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment