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