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