Kaydet (Commit) e09a8259 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

xmlhelp: Use appropriate OUString functions on string constants

Change-Id: I28f68ff0c43366b3877244ba272acf967f141e54
üst f273d670
...@@ -274,7 +274,7 @@ OString Databases::getImagesZipFileURL() ...@@ -274,7 +274,7 @@ OString Databases::getImagesZipFileURL()
if ( !aSymbolsStyleName.isEmpty() ) if ( !aSymbolsStyleName.isEmpty() )
{ {
if ( aSymbolsStyleName.equalsAscii("auto") ) if ( aSymbolsStyleName == "auto" )
{ {
// with the layered images*.zip, tango is the most // with the layered images*.zip, tango is the most
// complete theme, so show that one // complete theme, so show that one
...@@ -418,8 +418,8 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag ...@@ -418,8 +418,8 @@ const std::vector< OUString >& Databases::getModuleList( const OUString& Languag
( str[idx + 1] == 'c' || str[idx + 1] == 'C' ) && ( str[idx + 1] == 'c' || str[idx + 1] == 'C' ) &&
( str[idx + 2] == 'f' || str[idx + 2] == 'F' ) && ( str[idx + 2] == 'f' || str[idx + 2] == 'F' ) &&
( str[idx + 3] == 'g' || str[idx + 3] == 'G' ) && ( str[idx + 3] == 'g' || str[idx + 3] == 'G' ) &&
!( fileName = fileName.copy(0,idx).toAsciiLowerCase() ).equalsAscii( "picture" ) ) { ( fileName = fileName.copy(0,idx).toAsciiLowerCase() ) != "picture" ) {
if(! m_bShowBasic && fileName.equalsAscii("sbasic") ) if(! m_bShowBasic && fileName == "sbasic" )
continue; continue;
m_avModules.push_back( fileName ); m_avModules.push_back( fileName );
} }
...@@ -630,21 +630,21 @@ Databases::getCollator( const OUString& Language, ...@@ -630,21 +630,21 @@ Databases::getCollator( const OUString& Language,
OUString countryStr = country(Language); OUString countryStr = country(Language);
if( countryStr.isEmpty() ) if( countryStr.isEmpty() )
{ {
if( langStr.equalsAscii("de") ) if( langStr == "de" )
countryStr = "DE"; countryStr = "DE";
else if( langStr.equalsAscii("en") ) else if( langStr == "en" )
countryStr = "US"; countryStr = "US";
else if( langStr.equalsAscii("es") ) else if( langStr == "es" )
countryStr = "ES"; countryStr = "ES";
else if( langStr.equalsAscii("it") ) else if( langStr == "it" )
countryStr = "IT"; countryStr = "IT";
else if( langStr.equalsAscii("fr") ) else if( langStr == "fr" )
countryStr = "FR"; countryStr = "FR";
else if( langStr.equalsAscii("sv") ) else if( langStr == "sv" )
countryStr = "SE"; countryStr = "SE";
else if( langStr.equalsAscii("ja") ) else if( langStr == "ja" )
countryStr = "JP"; countryStr = "JP";
else if( langStr.equalsAscii("ko") ) else if( langStr == "ko" )
countryStr = "KR"; countryStr = "KR";
} }
/* FIXME-BCP47: all this does not look right for language tag context, /* FIXME-BCP47: all this does not look right for language tag context,
...@@ -1062,7 +1062,7 @@ void Databases::cascadingStylesheet( const OUString& Language, ...@@ -1062,7 +1062,7 @@ void Databases::cascadingStylesheet( const OUString& Language,
bool bHighContrastMode = false; bool bHighContrastMode = false;
OUString aCSS( m_aCSS ); OUString aCSS( m_aCSS );
if ( aCSS.equalsAscii( "default" ) ) if ( aCSS == "default" )
{ {
// #i50760: "default" needs to adapt HC mode // #i50760: "default" needs to adapt HC mode
uno::Reference< awt::XToolkit2 > xToolkit = uno::Reference< awt::XToolkit2 > xToolkit =
......
...@@ -246,7 +246,7 @@ ContentProvider::elementReplaced(const container::ContainerEvent& Event) ...@@ -246,7 +246,7 @@ ContentProvider::elementReplaced(const container::ContainerEvent& Event)
OUString accessor; OUString accessor;
Event.Accessor >>= accessor; Event.Accessor >>= accessor;
if(!accessor.equalsAscii("HelpStyleSheet")) if(accessor != "HelpStyleSheet")
return; return;
OUString replacedElement,element; OUString replacedElement,element;
......
...@@ -124,7 +124,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte ...@@ -124,7 +124,7 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
vector< OUString > aCompleteResultVector; vector< OUString > aCompleteResultVector;
OUString scope = m_aURLParameter.get_scope(); OUString scope = m_aURLParameter.get_scope();
bool bCaptionsOnly = scope.equalsAscii( "Heading" ); bool bCaptionsOnly = scope == "Heading";
sal_Int32 hitCount = m_aURLParameter.get_hitCount(); sal_Int32 hitCount = m_aURLParameter.get_hitCount();
IndexFolderIterator aIndexFolderIt( *pDatabases, m_aURLParameter.get_module(), m_aURLParameter.get_language() ); IndexFolderIterator aIndexFolderIt( *pDatabases, m_aURLParameter.get_module(), m_aURLParameter.get_language() );
......
...@@ -131,7 +131,7 @@ OString URLParameter::getByName( const char* par ) ...@@ -131,7 +131,7 @@ OString URLParameter::getByName( const char* par )
OUString URLParameter::get_id() OUString URLParameter::get_id()
{ {
if( m_aId.equalsAscii("start") ) if( m_aId == "start" )
{ // module is set { // module is set
StaticModuleInformation* inf = StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(), m_pDatabases->getStaticInformationForModule( get_module(),
...@@ -158,7 +158,7 @@ OUString URLParameter::get_title() ...@@ -158,7 +158,7 @@ OUString URLParameter::get_title()
{ {
if( isFile() ) if( isFile() )
return get_the_title(); return get_the_title();
else if( !m_aModule.equalsAscii("") ) else if( !m_aModule.isEmpty() )
{ {
StaticModuleInformation* inf = StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(), m_pDatabases->getStaticInformationForModule( get_module(),
...@@ -268,7 +268,7 @@ OUString URLParameter::get_the_jar() ...@@ -268,7 +268,7 @@ OUString URLParameter::get_the_jar()
void URLParameter::readHelpDataFile() void URLParameter::readHelpDataFile()
{ {
if( get_id().equalsAscii("") ) if( get_id().isEmpty() )
return; return;
OUString aModule = get_module(); OUString aModule = get_module();
...@@ -519,7 +519,7 @@ bool URLParameter::scheme() ...@@ -519,7 +519,7 @@ bool URLParameter::scheme()
sal_Int32 nLen = m_aExpr.getLength(); sal_Int32 nLen = m_aExpr.getLength();
OUString aLastStr = OUString aLastStr =
m_aExpr.copy(sal::static_int_cast<sal_uInt32>(nLen) - 6); m_aExpr.copy(sal::static_int_cast<sal_uInt32>(nLen) - 6);
if( aLastStr.equalsAscii( "DbPAR=" ) ) if( aLastStr == "DbPAR=" )
{ {
OUString aNewExpr = m_aExpr.copy( 0, 20 ); OUString aNewExpr = m_aExpr.copy( 0, 20 );
OUString aSharedStr("shared"); OUString aSharedStr("shared");
...@@ -618,39 +618,39 @@ bool URLParameter::query() ...@@ -618,39 +618,39 @@ bool URLParameter::query()
query_ = query_.copy( delimIdx+1 ).trim(); query_ = query_.copy( delimIdx+1 ).trim();
} }
if( parameter.equalsAscii( "Language" ) ) if( parameter == "Language" )
m_aLanguage = value; m_aLanguage = value;
else if( parameter.equalsAscii( "Device" ) ) else if( parameter == "Device" )
m_aDevice = value; m_aDevice = value;
else if( parameter.equalsAscii( "Program" ) ) else if( parameter == "Program" )
m_aProgram = value; m_aProgram = value;
else if( parameter.equalsAscii( "Eid" ) ) else if( parameter == "Eid" )
m_aEid = value; m_aEid = value;
else if( parameter.equalsAscii( "UseDB" ) ) else if( parameter == "UseDB" )
m_bUseDB = !value.equalsAscii("no"); m_bUseDB = value != "no";
else if( parameter.equalsAscii( "DbPAR" ) ) else if( parameter == "DbPAR" )
m_aDbPar = value; m_aDbPar = value;
else if( parameter.equalsAscii( "Query" ) ) else if( parameter == "Query" )
{ {
if( m_aQuery.isEmpty() ) if( m_aQuery.isEmpty() )
m_aQuery = value; m_aQuery = value;
else else
m_aQuery += ( OUString( " " ) + value ); m_aQuery += ( OUString( " " ) + value );
} }
else if( parameter.equalsAscii( "Scope" ) ) else if( parameter == "Scope" )
m_aScope = value; m_aScope = value;
else if( parameter.equalsAscii( "System" ) ) else if( parameter == "System" )
m_aSystem = value; m_aSystem = value;
else if( parameter.equalsAscii( "HelpPrefix" ) ) else if( parameter == "HelpPrefix" )
m_aPrefix = rtl::Uri::decode( m_aPrefix = rtl::Uri::decode(
value, value,
rtl_UriDecodeWithCharset, rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8 ); RTL_TEXTENCODING_UTF8 );
else if( parameter.equalsAscii( "HitCount" ) ) else if( parameter == "HitCount" )
m_nHitCount = value.toInt32(); m_nHitCount = value.toInt32();
else if( parameter.equalsAscii( "Active" ) ) else if( parameter == "Active" )
m_aActive = value; m_aActive = value;
else if( parameter.equalsAscii( "Version" ) ) else if( parameter == "Version" )
; // ignored (but accepted) in the build-in help, useful only for the online help ; // ignored (but accepted) in the build-in help, useful only for the online help
else else
ret = false; ret = false;
......
...@@ -108,7 +108,7 @@ TVFactory::createInstanceWithArguments( ...@@ -108,7 +108,7 @@ TVFactory::createInstanceWithArguments(
if( ! ( Arguments[i] >>= pV ) ) if( ! ( Arguments[i] >>= pV ) )
continue; continue;
if( !pV.Name.equalsAscii( "nodepath" ) ) if( pV.Name != "nodepath" )
continue; continue;
if( ! ( pV.Value >>= hierview ) ) if( ! ( pV.Value >>= hierview ) )
......
...@@ -262,11 +262,11 @@ TVRead::getByName( const OUString& aName ) ...@@ -262,11 +262,11 @@ TVRead::getByName( const OUString& aName )
{ {
bool found( true ); bool found( true );
Any aAny; Any aAny;
if( aName.equalsAscii( "Title" ) ) if( aName == "Title" )
aAny <<= Title; aAny <<= Title;
else if( aName.equalsAscii( "TargetURL" ) ) else if( aName == "TargetURL" )
aAny <<= TargetURL; aAny <<= TargetURL;
else if( aName.equalsAscii( "Children" ) ) else if( aName == "Children" )
{ {
cppu::OWeakObject* p = Children.get(); cppu::OWeakObject* p = Children.get();
aAny <<= Reference< XInterface >( p ); aAny <<= Reference< XInterface >( p );
...@@ -297,9 +297,9 @@ sal_Bool SAL_CALL ...@@ -297,9 +297,9 @@ sal_Bool SAL_CALL
TVRead::hasByName( const OUString& aName ) TVRead::hasByName( const OUString& aName )
throw( RuntimeException, std::exception ) throw( RuntimeException, std::exception )
{ {
if( aName.equalsAscii( "Title" ) || if( aName == "Title" ||
aName.equalsAscii( "TargetURL" ) || aName == "TargetURL" ||
aName.equalsAscii( "Children" ) ) aName == "Children" )
return true; return true;
return false; return false;
...@@ -316,7 +316,7 @@ TVRead::getByHierarchicalName( const OUString& aName ) ...@@ -316,7 +316,7 @@ TVRead::getByHierarchicalName( const OUString& aName )
OUString name( aName ); OUString name( aName );
if( ( idx = name.indexOf( '/' ) ) != -1 && if( ( idx = name.indexOf( '/' ) ) != -1 &&
name.copy( 0,idx ).equalsAscii( "Children" ) ) name.copy( 0,idx ) == "Children" )
return Children->getByHierarchicalName( name.copy( 1 + idx ) ); return Children->getByHierarchicalName( name.copy( 1 + idx ) );
return getByName( name ); return getByName( name );
...@@ -330,7 +330,7 @@ TVRead::hasByHierarchicalName( const OUString& aName ) ...@@ -330,7 +330,7 @@ TVRead::hasByHierarchicalName( const OUString& aName )
OUString name( aName ); OUString name( aName );
if( ( idx = name.indexOf( '/' ) ) != -1 && if( ( idx = name.indexOf( '/' ) ) != -1 &&
name.copy( 0,idx ).equalsAscii( "Children" ) ) name.copy( 0,idx ) == "Children" )
return Children->hasByHierarchicalName( name.copy( 1 + idx ) ); return Children->hasByHierarchicalName( name.copy( 1 + idx ) );
return hasByName( name ); return hasByName( name );
...@@ -732,7 +732,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext ) ...@@ -732,7 +732,7 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
( str[idx_ + 4] == 'e' || str[idx_ + 4] == 'E' ) ) ( str[idx_ + 4] == 'e' || str[idx_ + 4] == 'E' ) )
{ {
OUString baseName = aFileName.copy(0,idx_).toAsciiLowerCase(); OUString baseName = aFileName.copy(0,idx_).toAsciiLowerCase();
if(! showBasic && baseName.equalsAscii("sbasic") ) if(! showBasic && baseName == "sbasic" )
continue; continue;
osl::File aFile( aFileUrl ); osl::File aFile( aFileUrl );
if( osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) ) if( osl::FileBase::E_None == aFile.open( osl_File_OpenFlag_Read ) )
......
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