Kaydet (Commit) 8da92842 authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith

Remove RTL_CONSTASCII_(U)STRINGPARAM in ucb(ucp)

Change-Id: Iae4ea99e6eff6de8db3d40a6b86e5fd28ff857d0
üst d31bf8bf
......@@ -338,11 +338,11 @@ BaseContent::execute( const Command& aCommand,
Any aAny;
if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getPropertySetInfo"))) // No exceptions
if (aCommand.Name == "getPropertySetInfo") // No exceptions
{
aAny <<= getPropertySetInfo( CommandId );
}
else if (aCommand.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("getCommandInfo"))) // no exceptions
else if (aCommand.Name == "getCommandInfo") // no exceptions
{
aAny <<= getCommandInfo();
}
......
......@@ -87,7 +87,7 @@ XCommandInfo_impl::getCommandInfoByName(
if( m_pMyShell->m_sCommandInfo[i].Name == aName )
return m_pMyShell->m_sCommandInfo[i];
throw UnsupportedCommandException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw UnsupportedCommandException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
}
......@@ -101,7 +101,7 @@ XCommandInfo_impl::getCommandInfoByHandle(
if( m_pMyShell->m_sCommandInfo[i].Handle == Handle )
return m_pMyShell->m_sCommandInfo[i];
throw UnsupportedCommandException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw UnsupportedCommandException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
}
......
......@@ -136,7 +136,7 @@ XInputStream_impl::readBytes(
io::IOException,
uno::RuntimeException)
{
if( ! m_nIsOpen ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
if( ! m_nIsOpen ) throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
aData.realloc(nBytesToRead);
//TODO! translate memory exhaustion (if it were detectable...) into
......@@ -145,7 +145,7 @@ XInputStream_impl::readBytes(
sal_uInt64 nrc(0);
if(m_aFile.read( aData.getArray(),sal_uInt64(nBytesToRead),nrc )
!= osl::FileBase::E_None)
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
// Shrink aData in case we read less than nBytesToRead (XInputStream
// documentation does not tell whether this is required, and I do not know
......@@ -202,7 +202,7 @@ XInputStream_impl::closeInput(
{
osl::FileBase::RC err = m_aFile.close();
if( err != osl::FileBase::E_None )
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
m_nIsOpen = false;
}
}
......@@ -216,9 +216,9 @@ XInputStream_impl::seek(
uno::RuntimeException )
{
if( location < 0 )
throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 );
throw lang::IllegalArgumentException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >(), 0 );
if( osl::FileBase::E_None != m_aFile.setPos( osl_Pos_Absolut, sal_uInt64( location ) ) )
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
}
......@@ -230,7 +230,7 @@ XInputStream_impl::getPosition(
{
sal_uInt64 uPos;
if( osl::FileBase::E_None != m_aFile.getPos( uPos ) )
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
return sal_Int64( uPos );
}
......@@ -242,7 +242,7 @@ XInputStream_impl::getLength(
{
sal_uInt64 uEndPos;
if ( m_aFile.getSize(uEndPos) != osl::FileBase::E_None )
throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw io::IOException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
else
return sal_Int64( uEndPos );
}
......
......@@ -116,7 +116,7 @@ XPropertySetInfo_impl::getPropertyByName(
for( sal_Int32 i = 0; i < m_seq.getLength(); ++i )
if( m_seq[i].Name == aName ) return m_seq[i];
throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() );
throw beans::UnknownPropertyException( OUString( OSL_LOG_PREFIX ), uno::Reference< uno::XInterface >() );
}
......
......@@ -58,7 +58,7 @@ TaskManager::startTask(
if( it != m_aTaskMap.end() )
{
throw DuplicateCommandIdentifierException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ),
OUString( OSL_LOG_PREFIX ),
uno::Reference< uno::XInterface >() );
}
m_aTaskMap[ CommandId ] = TaskHandling( xCommandEnv );
......
......@@ -645,12 +645,12 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
#if OSL_DEBUG_LEVEL > 1
g_warning("Set prop '%s'", rtl::OUStringToOString(rValue.Name, RTL_TEXTENCODING_UTF8).getStr());
#endif
if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) )
if ( rValue.Name == "ContentType" ) ||
rValue.Name == "MediaType" ) ||
rValue.Name == "IsDocument" ) ||
rValue.Name == "IsFolder" ) ||
rValue.Name == "Size" ) ||
rValue.Name == "CreatableContentsInfo" ) )
{
aRet[ n ] <<= getReadOnlyException( static_cast< cppu::OWeakObject * >(this) );
}
......@@ -931,7 +931,7 @@ uno::Any SAL_CALL Content::execute(
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= setPropertyValues( aProperties, xEnv );
}
else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) )
else if (aCommand.Name.equals == "createNewContent" )
&& isFolder( xEnv ) )
{
ucb::ContentInfo arg;
......
......@@ -649,8 +649,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
else
xRow->appendVoid( rProp );
else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsVolume" ) ) ||
rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsCompactDisk" ) ) )
else if ( rProp.Name == "IsVolume" || rProp.Name == "IsCompactDisk" )
xRow->appendBoolean( rProp, sal_False );
else if ( rProp.Name == "DateCreated" ) {
......@@ -784,12 +783,12 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
#if OSL_DEBUG_LEVEL > 1
g_warning( "Set prop '%s'", OUStringToGnome( rValue.Name ) );
#endif
if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ||
rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) )
if ( rValue.Name == "ContentType" ||
rValue.Name == "MediaType" ||
rValue.Name == "IsDocument" ||
rValue.Name == "IsFolder" ||
rValue.Name == "Size" ||
rValue.Name == "CreatableContentsInfo" )
aRet[ n ] <<= getReadOnlyException( this );
else if ( rValue.Name == "Title" ) {
......
......@@ -599,7 +599,7 @@ bool OfficeDocumentsManager::isHelpDocument(
return false;
::rtl::OUString sURL( xModel->getURL() );
if ( sURL.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.help://" ) ) )
if ( sURL.match( "vnd.sun.star.help://" ) )
return true;
return false;
......
......@@ -97,10 +97,8 @@ XTYPEPROVIDER_IMPL_4( ContentProvider,
XSERVICEINFO_IMPL_1_CTX(
ContentProvider,
rtl::OUString(
"com.sun.star.comp.ucb.TransientDocumentsContentProvider" ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
TDOC_CONTENT_PROVIDER_SERVICE_NAME ) ) );
OUString( "com.sun.star.comp.ucb.TransientDocumentsContentProvider" ),
OUString( TDOC_CONTENT_PROVIDER_SERVICE_NAME ) );
//=========================================================================
//
......
......@@ -413,15 +413,14 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage(
{
if ( eMode == READ_WRITE_CREATE )
throw lang::IllegalArgumentException(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
rtl::OUString(
"Invalid open mode: document storages cannot be "
"created!" ) ),
"created!" ),
uno::Reference< uno::XInterface >(),
sal_Int16( 2 ) );
else
throw embed::InvalidStorageException(
rtl::OUString(
"Invalid document id!" ),
rtl::OUString( "Invalid document id!" ),
uno::Reference< uno::XInterface >() );
}
......
......@@ -140,8 +140,7 @@ extern "C" int NPFR_propfind_iter( void* userdata,
if ( !aValue.isEmpty() )
{
aValue = stripDavNamespace( aValue ).toAsciiLowerCase();
if ( aValue.compareTo(
RTL_CONSTASCII_STRINGPARAM( "<collection" ) ) == 0 )
if ( aValue.compareTo( "<collection" ) == 0 )
{
thePropertyValue.Value
<<= OUString("collection");
......
......@@ -231,15 +231,12 @@ void ContentProperties::UCBNamesToDAVNames(
{
const beans::Property & rProp = rProps[ n ];
if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "Title" ) ) )
if ( rProp.Name == "Title" )
{
// Title is always obtained from resource's URI.
continue;
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) )
||
else if ( rProp.Name == "DateCreated" ||
( rProp.Name == DAVProperties::CREATIONDATE ) )
{
if ( !bCreationDate )
......@@ -248,9 +245,7 @@ void ContentProperties::UCBNamesToDAVNames(
bCreationDate = sal_True;
}
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "DateModified" ) )
||
else if ( rProp.Name == "DateModified" ||
( rProp.Name == DAVProperties::GETLASTMODIFIED ) )
{
if ( !bLastModified )
......@@ -260,9 +255,7 @@ void ContentProperties::UCBNamesToDAVNames(
bLastModified = sal_True;
}
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "MediaType" ) )
||
else if ( rProp.Name == "MediaType" ||
( rProp.Name == DAVProperties::GETCONTENTTYPE ) )
{
if ( !bContentType )
......@@ -272,9 +265,7 @@ void ContentProperties::UCBNamesToDAVNames(
bContentType = sal_True;
}
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "Size" ) )
||
else if ( rProp.Name == "Size" ||
( rProp.Name == DAVProperties::GETCONTENTLENGTH ) )
{
if ( !bContentLength )
......@@ -284,15 +275,9 @@ void ContentProperties::UCBNamesToDAVNames(
bContentLength = sal_True;
}
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "ContentType" ) )
||
rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) )
||
rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) )
||
else if ( rProp.Name == "ContentType" ||
rProp.Name == "IsDocument" ||
rProp.Name == "IsFolder" ||
( rProp.Name == DAVProperties::RESOURCETYPE ) )
{
if ( !bResourceType )
......@@ -331,20 +316,17 @@ void ContentProperties::UCBNamesToHTTPNames(
{
const beans::Property & rProp = rProps[ n ];
if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) )
if ( rProp.Name == "DateModified" )
{
propertyNames.push_back(
rtl::OUString::createFromAscii( "Last-Modified" ) );
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) )
else if ( rProp.Name == "MediaType" )
{
propertyNames.push_back(
rtl::OUString::createFromAscii( "Content-Type" ) );
}
else if ( rProp.Name.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "Size" ) ) )
else if ( rProp.Name == "Size" )
{
propertyNames.push_back(
rtl::OUString::createFromAscii( "Content-Length" ) );
......@@ -446,7 +428,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
const com::sun::star::uno::Any & rValue,
bool bIsCaseSensitive )
{
if ( rName.equals( DAVProperties::CREATIONDATE ) )
if ( rName == DAVProperties::CREATIONDATE ) )
{
// Map DAV:creationdate to UCP:DateCreated
rtl::OUString aValue;
......@@ -463,7 +445,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
// else if ( rName.equals( DAVProperties::GETCONTENTLANGUAGE ) )
// {
// }
else if ( rName.equals( DAVProperties::GETCONTENTLENGTH ) )
else if ( rName == DAVProperties::GETCONTENTLENGTH ) )
{
// Map DAV:getcontentlength to UCP:Size
rtl::OUString aValue;
......@@ -472,8 +454,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
(*m_xProps)[ rtl::OUString::createFromAscii( "Size" ) ]
= PropertyValue( uno::makeAny( aValue.toInt64() ), true );
}
else if ( rName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "Content-Length" ) ) )
else if ( rName == "Content-Length" )
{
// Do NOT map Content-Length entity header to DAV:getcontentlength!
// Only DAV resources have this property.
......@@ -485,13 +466,13 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
(*m_xProps)[ rtl::OUString::createFromAscii( "Size" ) ]
= PropertyValue( uno::makeAny( aValue.toInt64() ), true );
}
else if ( rName.equals( DAVProperties::GETCONTENTTYPE ) )
else if ( rName == DAVProperties::GETCONTENTTYPE ) )
{
// Map DAV:getcontenttype to UCP:MediaType (1:1)
(*m_xProps)[ rtl::OUString::createFromAscii( "MediaType" ) ]
= PropertyValue( rValue, true );
}
else if ( rName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Content-Type" ) ) )
else if ( rName == "Content-Type" )
{
// Do NOT map Content-Type entity header to DAV:getcontenttype!
// Only DAV resources have this property.
......@@ -503,7 +484,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
// else if ( rName.equals( DAVProperties::GETETAG ) )
// {
// }
else if ( rName.equals( DAVProperties::GETLASTMODIFIED ) )
else if ( rName == DAVProperties::GETLASTMODIFIED )
{
// Map the DAV:getlastmodified entity header to UCP:DateModified
rtl::OUString aValue;
......@@ -514,8 +495,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
(*m_xProps)[ rtl::OUString::createFromAscii( "DateModified" ) ]
= PropertyValue( uno::makeAny( aDate ), true );
}
else if ( rName.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM( "Last-Modified" ) ) )
else if ( rName == "Last-Modified" )
{
// Do not map Last-Modified entity header to DAV:getlastmodified!
// Only DAV resources have this property.
......@@ -532,15 +512,14 @@ void ContentProperties::addProperty( const rtl::OUString & rName,
// else if ( rName.equals( DAVProperties::LOCKDISCOVERY ) )
// {
// }
else if ( rName.equals( DAVProperties::RESOURCETYPE ) )
else if ( rName == DAVProperties::RESOURCETYPE ) )
{
rtl::OUString aValue;
rValue >>= aValue;
// Map DAV:resourceype to UCP:IsFolder, UCP:IsDocument, UCP:ContentType
sal_Bool bFolder =
aValue.equalsIgnoreAsciiCaseAsciiL(
RTL_CONSTASCII_STRINGPARAM( "collection" ) );
aValue.equalsIgnoreAsciiCase( "collection" );
(*m_xProps)[ rtl::OUString::createFromAscii( "IsFolder" ) ]
= PropertyValue( uno::makeAny( bFolder ), true );
......
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