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

ucb: Use appropriate OUString functions on string constants

Change-Id: I6839e032c981fcff472f29c51c84503d6370fd1c
üst 34a90379
......@@ -820,7 +820,7 @@ void transferProperties(
uno::Any aValue;
if ( rCurrProp.Name.equalsAscii( "Title" ) )
if ( rCurrProp.Name == "Title" )
{
// Supply new title, if given.
if ( !bHasTitle )
......@@ -829,7 +829,7 @@ void transferProperties(
aValue <<= rContext.aArg.NewTitle;
}
}
else if ( rCurrProp.Name.equalsAscii( "TargetURL" ) )
else if ( rCurrProp.Name == "TargetURL" )
{
// Supply source URL as link target for the new link to create.
if ( !bHasTargetURL )
......
......@@ -859,8 +859,7 @@ void SAL_CALL SortedResultSet::setPropertyValue(
{
osl::Guard< osl::Mutex > aGuard( maMutex );
if ( PropertyName.equalsAscii( "RowCount" ) ||
PropertyName.equalsAscii( "IsRowCountFinal" ) )
if ( PropertyName == "RowCount" || PropertyName == "IsRowCountFinal" )
throw IllegalArgumentException();
else
throw UnknownPropertyException();
......@@ -876,11 +875,11 @@ Any SAL_CALL SortedResultSet::getPropertyValue( const OUString& PropertyName )
Any aRet;
if ( PropertyName.equalsAscii( "RowCount" ) )
if ( PropertyName == "RowCount" )
{
aRet <<= maS2O.Count();
}
else if ( PropertyName.equalsAscii( "IsRowCountFinal" ) )
else if ( PropertyName == "IsRowCountFinal" )
{
bool bOrgFinal = false;
Any aOrgRet;
......@@ -1981,9 +1980,9 @@ Property SAL_CALL
SRSPropertySetInfo::getPropertyByName( const OUString& Name )
throw( UnknownPropertyException, RuntimeException, std::exception )
{
if ( Name.equalsAscii( "RowCount" ) )
if ( Name == "RowCount" )
return maProps[0];
else if ( Name.equalsAscii( "IsRowCountFinal" ) )
else if ( Name == "IsRowCountFinal" )
return maProps[1];
else
throw UnknownPropertyException();
......@@ -1994,9 +1993,9 @@ sal_Bool SAL_CALL
SRSPropertySetInfo::hasPropertyByName( const OUString& Name )
throw( RuntimeException, std::exception )
{
if ( Name.equalsAscii( "RowCount" ) )
if ( Name == "RowCount" )
return sal_True;
else if ( Name.equalsAscii( "IsRowCountFinal" ) )
else if ( Name == "IsRowCountFinal" )
return sal_True;
else
return sal_False;
......
......@@ -700,7 +700,7 @@ XResultSet_impl::getMetaData(
{
for ( sal_Int32 n = 0; n < m_sProperty.getLength(); ++n )
{
if ( m_sProperty.getConstArray()[ n ].Name.equalsAscii( "Title" ) )
if ( m_sProperty.getConstArray()[ n ].Name == "Title" )
{
// @@@ #82177# - Determine correct value!
bool bCaseSensitiveChildren = false;
......
......@@ -114,7 +114,7 @@ FileProvider::initialize(
OUString config;
if( aArguments.getLength() > 0 &&
(aArguments[0] >>= config) &&
config.equalsAscii("NoConfig") )
config == "NoConfig" )
m_pMyShell = new shell( m_xContext, this, false );
else
m_pMyShell = new shell( m_xContext, this, true );
......@@ -473,9 +473,9 @@ FileProvider::setPropertyValue( const OUString& aPropertyName,
WrappedTargetException,
RuntimeException, std::exception )
{
if( aPropertyName.equalsAscii( "FileSystemNotation" ) ||
aPropertyName.equalsAscii( "HomeDirectory" ) ||
aPropertyName.equalsAscii( "HostName" ) )
if( aPropertyName == "FileSystemNotation" ||
aPropertyName == "HomeDirectory" ||
aPropertyName == "HostName" )
return;
else
throw UnknownPropertyException( THROW_WHERE );
......@@ -491,19 +491,19 @@ FileProvider::getPropertyValue(
RuntimeException, std::exception )
{
initProperties();
if( aPropertyName.equalsAscii( "FileSystemNotation" ) )
if( aPropertyName == "FileSystemNotation" )
{
Any aAny;
aAny <<= m_FileSystemNotation;
return aAny;
}
else if( aPropertyName.equalsAscii( "HomeDirectory" ) )
else if( aPropertyName == "HomeDirectory" )
{
Any aAny;
aAny <<= m_HomeDirectory;
return aAny;
}
else if( aPropertyName.equalsAscii( "HostName" ) )
else if( aPropertyName == "HostName" )
{
Any aAny;
aAny <<= m_HostName;
......
......@@ -435,7 +435,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
break;
}
if(aCommand.Name.equalsAscii("getPropertyValues")) {
if(aCommand.Name == "getPropertyValues") {
Sequence<Property> Properties;
if(!(aCommand.Argument >>= Properties))
{
......@@ -448,7 +448,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
aRet <<= getPropertyValues(Properties,Environment);
}
else if(aCommand.Name.equalsAscii("setPropertyValues") )
else if(aCommand.Name == "setPropertyValues")
{
Sequence<PropertyValue> propertyValues;
......@@ -462,15 +462,15 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
aRet <<= setPropertyValues(propertyValues);
}
else if(aCommand.Name.equalsAscii("getCommandInfo")) {
else if(aCommand.Name == "getCommandInfo") {
// Note: Implemented by base class.
aRet <<= getCommandInfo(Environment);
}
else if(aCommand.Name.equalsAscii("getPropertySetInfo")) {
else if(aCommand.Name == "getPropertySetInfo") {
// Note: Implemented by base class.
aRet <<= getPropertySetInfo(Environment);
}
else if(aCommand.Name.equalsAscii( "insert" ))
else if(aCommand.Name == "insert")
{
InsertCommandArgument aInsertArgument;
if ( ! ( aCommand.Argument >>= aInsertArgument ) ) {
......@@ -482,11 +482,11 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
}
insert(aInsertArgument,Environment);
}
else if(aCommand.Name.equalsAscii("delete")) {
else if(aCommand.Name == "delete") {
m_aFTPURL.del();
deleted();
}
else if(aCommand.Name.equalsAscii( "open" )) {
else if(aCommand.Name == "open") {
OpenCommandArgument2 aOpenCommand;
if ( !( aCommand.Argument >>= aOpenCommand ) ) {
aRet <<= IllegalArgumentException(
......@@ -590,7 +590,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand,
ucbhelper::cancelCommandExecution(aRet,Environment);
}
} else if(aCommand.Name.equalsAscii("createNewContent")) {
} else if(aCommand.Name == "createNewContent") {
ContentInfo aArg;
if (!(aCommand.Argument >>= aArg)) {
ucbhelper::cancelCommandExecution(
......@@ -837,35 +837,35 @@ Reference< XRow > FTPContent::getPropertyValues(
for(sal_Int32 i = 0; i < seqProp.getLength(); ++i) {
const OUString& Name = seqProp[i].Name;
if(Name.equalsAscii("Title"))
if(Name == "Title")
xRow->appendString(seqProp[i],aDirEntry.m_aName);
else if(Name.equalsAscii("CreatableContentsInfo"))
else if(Name == "CreatableContentsInfo")
xRow->appendObject(seqProp[i],
makeAny(queryCreatableContentsInfo()));
else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) {
if(Name.equalsAscii("ContentType"))
if(Name == "ContentType")
xRow->appendString(seqProp[i],
aDirEntry.m_nMode&INETCOREFTP_FILEMODE_ISDIR
? FTP_FOLDER
: FTP_FILE );
else if(Name.equalsAscii("IsReadOnly"))
else if(Name == "IsReadOnly")
xRow->appendBoolean(seqProp[i],
aDirEntry.m_nMode
& INETCOREFTP_FILEMODE_WRITE
? 0
: 1 );
else if(Name.equalsAscii("IsDocument"))
else if(Name == "IsDocument")
xRow->appendBoolean(seqProp[i],
(aDirEntry.m_nMode &
INETCOREFTP_FILEMODE_ISDIR) != INETCOREFTP_FILEMODE_ISDIR);
else if(Name.equalsAscii("IsFolder"))
else if(Name == "IsFolder")
xRow->appendBoolean(seqProp[i],
(aDirEntry.m_nMode &
INETCOREFTP_FILEMODE_ISDIR) == INETCOREFTP_FILEMODE_ISDIR);
else if(Name.equalsAscii("Size"))
else if(Name == "Size")
xRow->appendLong(seqProp[i],
aDirEntry.m_nSize);
else if(Name.equalsAscii("DateCreated"))
else if(Name == "DateCreated")
xRow->appendTimestamp(seqProp[i],
aDirEntry.m_aDate);
else
......
......@@ -60,30 +60,30 @@ ResultSetI::ResultSetI(const Reference<XComponentContext>& rxContext,
for( int i = 0; i < seqProp.getLength(); ++i) {
const OUString& Name = seqProp[i].Name;
if(Name.equalsAscii("ContentType") )
if(Name == "ContentType")
xRow->appendString(seqProp[i],
OUString( "application/ftp" ));
else if(Name.equalsAscii("Title"))
else if(Name == "Title")
xRow->appendString(seqProp[i],dirvec[n].m_aName);
else if(Name.equalsAscii("IsReadOnly"))
else if(Name == "IsReadOnly")
xRow->appendBoolean(seqProp[i],
(dirvec[n].m_nMode &
INETCOREFTP_FILEMODE_WRITE) == INETCOREFTP_FILEMODE_WRITE);
else if(Name.equalsAscii("IsDocument"))
else if(Name == "IsDocument")
xRow->appendBoolean(seqProp[i],
(dirvec[n].m_nMode &
INETCOREFTP_FILEMODE_ISDIR) != INETCOREFTP_FILEMODE_ISDIR);
else if(Name.equalsAscii("IsFolder"))
else if(Name == "IsFolder")
xRow->appendBoolean(seqProp[i],
( dirvec[n].m_nMode &
INETCOREFTP_FILEMODE_ISDIR) == INETCOREFTP_FILEMODE_ISDIR);
else if(Name.equalsAscii("Size"))
else if(Name == "Size")
xRow->appendLong(seqProp[i],
dirvec[n].m_nSize);
else if(Name.equalsAscii("DateCreated"))
else if(Name == "DateCreated")
xRow->appendTimestamp(seqProp[i],
dirvec[n].m_aDate);
else if(Name.equalsAscii("CreatableContentsInfo"))
else if(Name == "CreatableContentsInfo")
xRow->appendObject(
seqProp[i],
makeAny(FTPContent::queryCreatableContentsInfo_Static()));
......
......@@ -117,29 +117,29 @@ bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s,
sal_Int32 DateTimeHelper::convertMonthToInt (const OUString& month)
{
if (month.equalsAscii("Jan"))
if (month == "Jan")
return 1;
else if (month.equalsAscii("Feb"))
else if (month == "Feb")
return 2;
else if (month.equalsAscii("Mar"))
else if (month == "Mar")
return 3;
else if (month.equalsAscii("Apr"))
else if (month == "Apr")
return 4;
else if (month.equalsAscii("May"))
else if (month == "May")
return 5;
else if (month.equalsAscii("Jun"))
else if (month == "Jun")
return 6;
else if (month.equalsAscii("Jul"))
else if (month == "Jul")
return 7;
else if (month.equalsAscii("Aug"))
else if (month == "Aug")
return 8;
else if (month.equalsAscii("Sep"))
else if (month == "Sep")
return 9;
else if (month.equalsAscii("Oct"))
else if (month == "Oct")
return 10;
else if (month.equalsAscii("Nov"))
else if (month == "Nov")
return 11;
else if (month.equalsAscii("Dec"))
else if (month == "Dec")
return 12;
else
return 0;
......
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