Kaydet (Commit) 1c0371a5 authored tarafından Noel Grandin's avatar Noel Grandin

sd: boost::ptr_vector->std::vector

Change-Id: Idff9e260f180ea4d68ae7c04414d61f5f5887f0b
üst afc3f660
...@@ -154,7 +154,7 @@ sal_uInt32 ExSoundCollection::GetId(const OUString& rString) ...@@ -154,7 +154,7 @@ sal_uInt32 ExSoundCollection::GetId(const OUString& rString)
if (!rString.isEmpty()) if (!rString.isEmpty())
{ {
const sal_uInt32 nSoundCount = maEntries.size(); const sal_uInt32 nSoundCount = maEntries.size();
boost::ptr_vector<ExSoundEntry>::const_iterator iter; std::vector<ExSoundEntry>::const_iterator iter;
for (iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++nSoundId) for (iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++nSoundId)
{ {
...@@ -164,13 +164,12 @@ sal_uInt32 ExSoundCollection::GetId(const OUString& rString) ...@@ -164,13 +164,12 @@ sal_uInt32 ExSoundCollection::GetId(const OUString& rString)
if ( nSoundId++ == nSoundCount ) if ( nSoundId++ == nSoundCount )
{ {
ExSoundEntry* pEntry = new ExSoundEntry( rString ); ExSoundEntry aEntry( rString );
if ( pEntry->GetFileSize() ) if ( aEntry.GetFileSize() )
maEntries.push_back(pEntry); maEntries.push_back(aEntry);
else else
{ {
nSoundId = 0; // only insert sounds that are accessible nSoundId = 0; // only insert sounds that are accessible
delete pEntry;
} }
} }
} }
...@@ -183,7 +182,7 @@ sal_uInt32 ExSoundCollection::GetSize() const ...@@ -183,7 +182,7 @@ sal_uInt32 ExSoundCollection::GetSize() const
if (!maEntries.empty()) if (!maEntries.empty())
{ {
nSize += 8 + 12; // size of SoundCollectionContainerHeader + SoundCollAtom nSize += 8 + 12; // size of SoundCollectionContainerHeader + SoundCollAtom
boost::ptr_vector<ExSoundEntry>::const_iterator iter; std::vector<ExSoundEntry>::const_iterator iter;
sal_uInt32 i = 1; sal_uInt32 i = 1;
for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++i) for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++i)
nSize += iter->GetSize(i); nSize += iter->GetSize(i);
...@@ -204,7 +203,7 @@ void ExSoundCollection::Write( SvStream& rSt ) const ...@@ -204,7 +203,7 @@ void ExSoundCollection::Write( SvStream& rSt ) const
// create SoundCollAtom ( reference to the next free SoundId ); // create SoundCollAtom ( reference to the next free SoundId );
rSt.WriteUInt32( EPP_SoundCollAtom << 16 ).WriteUInt32( 4 ).WriteUInt32( nSoundCount ); rSt.WriteUInt32( EPP_SoundCollAtom << 16 ).WriteUInt32( 4 ).WriteUInt32( nSoundCount );
boost::ptr_vector<ExSoundEntry>::const_iterator iter; std::vector<ExSoundEntry>::const_iterator iter;
for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++i) for ( iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++i)
iter->Write(rSt,i); iter->Write(rSt,i);
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef INCLUDED_SD_SOURCE_FILTER_EPPT_PPTEXSOUNDCOLLECTION_HXX #ifndef INCLUDED_SD_SOURCE_FILTER_EPPT_PPTEXSOUNDCOLLECTION_HXX
#define INCLUDED_SD_SOURCE_FILTER_EPPT_PPTEXSOUNDCOLLECTION_HXX #define INCLUDED_SD_SOURCE_FILTER_EPPT_PPTEXSOUNDCOLLECTION_HXX
#include <boost/ptr_container/ptr_vector.hpp> #include <vector>
#ifdef DBG_ANIM_LOG #ifdef DBG_ANIM_LOG
#include <stdio.h> #include <stdio.h>
...@@ -34,7 +34,7 @@ namespace ppt ...@@ -34,7 +34,7 @@ namespace ppt
class ExSoundEntry class ExSoundEntry
{ {
sal_uInt32 nFileSize; sal_uInt32 nFileSize;
OUString aSoundURL; OUString aSoundURL;
OUString ImplGetName() const; OUString ImplGetName() const;
...@@ -43,13 +43,13 @@ class ExSoundEntry ...@@ -43,13 +43,13 @@ class ExSoundEntry
public: public:
bool IsSameURL(const OUString& rURL) const; bool IsSameURL(const OUString& rURL) const;
sal_uInt32 GetFileSize( ) const { return nFileSize; }; sal_uInt32 GetFileSize( ) const { return nFileSize; };
ExSoundEntry(const OUString& rSoundURL); ExSoundEntry(const OUString& rSoundURL);
/// @return size of a complete SoundContainer. /// @return size of a complete SoundContainer.
sal_uInt32 GetSize( sal_uInt32 nId ) const; sal_uInt32 GetSize( sal_uInt32 nId ) const;
void Write( SvStream& rSt, sal_uInt32 nId ) const; void Write( SvStream& rSt, sal_uInt32 nId ) const;
}; };
class ExSoundCollection class ExSoundCollection
...@@ -64,7 +64,7 @@ class ExSoundCollection ...@@ -64,7 +64,7 @@ class ExSoundCollection
private: private:
boost::ptr_vector<ExSoundEntry> maEntries; std::vector<ExSoundEntry> maEntries;
}; };
} // namespace ppt } // namespace ppt
......
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