Kaydet (Commit) d3c0bf6c authored tarafından Caolán McNamara's avatar Caolán McNamara

drop tools/string.hxx include

üst 3e41fd07
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
namespace ppt namespace ppt
{ {
ExSoundEntry::ExSoundEntry( const String& rString ) ExSoundEntry::ExSoundEntry(const rtl::OUString& rString)
: nFileSize( 0 ) : nFileSize(0)
, aSoundURL( rString ) , aSoundURL(rString)
{ {
try try
{ {
...@@ -55,13 +55,13 @@ ExSoundEntry::ExSoundEntry( const String& rString ) ...@@ -55,13 +55,13 @@ ExSoundEntry::ExSoundEntry( const String& rString )
} }
}; };
String ExSoundEntry::ImplGetName() const rtl::OUString ExSoundEntry::ImplGetName() const
{ {
INetURLObject aTmp( aSoundURL ); INetURLObject aTmp( aSoundURL );
return aTmp.GetName(); return aTmp.GetName();
} }
String ExSoundEntry::ImplGetExtension() const rtl::OUString ExSoundEntry::ImplGetExtension() const
{ {
INetURLObject aTmp( aSoundURL ); INetURLObject aTmp( aSoundURL );
String aExtension( aTmp.GetExtension() ); String aExtension( aTmp.GetExtension() );
...@@ -70,24 +70,24 @@ String ExSoundEntry::ImplGetExtension() const ...@@ -70,24 +70,24 @@ String ExSoundEntry::ImplGetExtension() const
return aExtension; return aExtension;
} }
sal_Bool ExSoundEntry::IsSameURL( const String& rURL ) const sal_Bool ExSoundEntry::IsSameURL(const rtl::OUString& rURL) const
{ {
return ( rURL == aSoundURL ); return ( rURL == aSoundURL );
} }
sal_uInt32 ExSoundEntry::GetSize( sal_uInt32 nId ) const sal_uInt32 ExSoundEntry::GetSize( sal_uInt32 nId ) const
{ {
String aName( ImplGetName() ); rtl::OUString aName( ImplGetName() );
String aExtension( ImplGetExtension() ); rtl::OUString aExtension( ImplGetExtension() );
sal_uInt32 nSize = 8; // SoundContainer Header sal_uInt32 nSize = 8; // SoundContainer Header
if ( aName.Len() ) // String Atom ( instance 0 - name of sound ) if ( !aName.isEmpty() ) // String Atom ( instance 0 - name of sound )
nSize += aName.Len() * 2 + 8; nSize += aName.getLength() * 2 + 8;
if ( aExtension.Len() ) // String Atom ( instance 1 - extension of sound ) if ( !aExtension.isEmpty() ) // String Atom ( instance 1 - extension of sound )
nSize += aExtension.Len() * 2 + 8; nSize += aExtension.getLength() * 2 + 8;
String aId( String::CreateFromInt32( nId ) ); // String Atom ( instance 2 - reference id ) rtl::OUString aId( rtl::OUString::valueOf(static_cast<sal_Int32>(nId)) ); // String Atom ( instance 2 - reference id )
nSize += 2 * aId.Len() + 8; nSize += 2 * aId.getLength() + 8;
nSize += nFileSize + 8; // SoundData Atom nSize += nFileSize + 8; // SoundData Atom
...@@ -104,30 +104,30 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const ...@@ -104,30 +104,30 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const
// create SoundContainer // create SoundContainer
rSt << (sal_uInt32)( ( EPP_Sound << 16 ) | 0xf ) << (sal_uInt32)( GetSize( nId ) - 8 ); rSt << (sal_uInt32)( ( EPP_Sound << 16 ) | 0xf ) << (sal_uInt32)( GetSize( nId ) - 8 );
String aSoundName( ImplGetName() ); rtl::OUString aSoundName( ImplGetName() );
sal_uInt16 i, nSoundNameLen = aSoundName.Len(); sal_Int32 i, nSoundNameLen = aSoundName.getLength();
if ( nSoundNameLen ) if ( nSoundNameLen )
{ {
// name of sound ( instance 0 ) // name of sound ( instance 0 )
rSt << (sal_uInt32)( EPP_CString << 16 ) << (sal_uInt32)( nSoundNameLen * 2 ); rSt << (sal_uInt32)( EPP_CString << 16 ) << (sal_uInt32)( nSoundNameLen * 2 );
for ( i = 0; i < nSoundNameLen; i++ ) for ( i = 0; i < nSoundNameLen; ++i )
rSt << aSoundName.GetChar( i ); rSt << aSoundName[i];
} }
String aExtension( ImplGetExtension() ); rtl::OUString aExtension( ImplGetExtension() );
sal_uInt32 nExtensionLen = aExtension.Len(); sal_Int32 nExtensionLen = aExtension.getLength();
if ( nExtensionLen ) if ( nExtensionLen )
{ {
// extension of sound ( instance 1 ) // extension of sound ( instance 1 )
rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 16 ) << (sal_uInt32)( nExtensionLen * 2 ); rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 16 ) << (sal_uInt32)( nExtensionLen * 2 );
for ( i = 0; i < nExtensionLen; i++ ) for ( i = 0; i < nExtensionLen; ++i )
rSt << aExtension.GetChar( i ); rSt << aExtension[i];
} }
// id of sound ( instance 2 ) // id of sound ( instance 2 )
String aId( String::CreateFromInt32( nId ) ); rtl::OUString aId( rtl::OUString::valueOf(static_cast<sal_Int32>(nId) ) );
sal_uInt32 nIdLen = aId.Len(); sal_Int32 nIdLen = aId.getLength();
rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 32 ) << (sal_uInt32)( nIdLen * 2 ); rSt << (sal_uInt32)( ( EPP_CString << 16 ) | 32 ) << (sal_uInt32)( nIdLen * 2 );
for ( i = 0; i < nIdLen; i++ ) for ( i = 0; i < nIdLen; ++i )
rSt << aId.GetChar( i ); rSt << aId[i];
rSt << (sal_uInt32)( EPP_SoundData << 16 ) << (sal_uInt32)( nFileSize ); rSt << (sal_uInt32)( EPP_SoundData << 16 ) << (sal_uInt32)( nFileSize );
sal_uInt32 nBytesLeft = nFileSize; sal_uInt32 nBytesLeft = nFileSize;
...@@ -152,10 +152,10 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const ...@@ -152,10 +152,10 @@ void ExSoundEntry::Write( SvStream& rSt, sal_uInt32 nId ) const
} }
} }
sal_uInt32 ExSoundCollection::GetId( const String& rString ) sal_uInt32 ExSoundCollection::GetId(const rtl::OUString& rString)
{ {
sal_uInt32 nSoundId = 0; sal_uInt32 nSoundId = 0;
if( rString.Len() ) if (!rString.isEmpty())
{ {
const sal_uInt32 nSoundCount = maEntries.size(); const sal_uInt32 nSoundCount = maEntries.size();
boost::ptr_vector<ExSoundEntry>::const_iterator iter; boost::ptr_vector<ExSoundEntry>::const_iterator iter;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#ifdef DBG_ANIM_LOG #ifdef DBG_ANIM_LOG
#include <stdio.h> #include <stdio.h>
#endif #endif
#include <tools/string.hxx> #include <rtl/ustring.hxx>
#include <tools/stream.hxx> #include <tools/stream.hxx>
namespace ppt namespace ppt
...@@ -43,17 +43,17 @@ namespace ppt ...@@ -43,17 +43,17 @@ namespace ppt
class ExSoundEntry class ExSoundEntry
{ {
sal_uInt32 nFileSize; sal_uInt32 nFileSize;
String aSoundURL; rtl::OUString aSoundURL;
String ImplGetName() const; rtl::OUString ImplGetName() const;
String ImplGetExtension() const; rtl::OUString ImplGetExtension() const;
public : public :
sal_Bool IsSameURL( const String& rURL ) const; sal_Bool IsSameURL(const rtl::OUString& rURL) const;
sal_uInt32 GetFileSize( ) const { return nFileSize; }; sal_uInt32 GetFileSize( ) const { return nFileSize; };
ExSoundEntry( const String& rSoundURL ); ExSoundEntry(const rtl::OUString& rSoundURL);
// returns the size of a complete SoundContainer // returns the size of a complete SoundContainer
sal_uInt32 GetSize( sal_uInt32 nId ) const; sal_uInt32 GetSize( sal_uInt32 nId ) const;
...@@ -64,7 +64,7 @@ class ExSoundCollection ...@@ -64,7 +64,7 @@ class ExSoundCollection
{ {
public: public:
sal_uInt32 GetId( const String& ); sal_uInt32 GetId(const rtl::OUString&);
// returns the size of a complete SoundCollectionContainer // returns the size of a complete SoundCollectionContainer
sal_uInt32 GetSize() const; sal_uInt32 GetSize() const;
......
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