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 @@
#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();
......
......@@ -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;
......
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