diff options
author | Daniel Rentz <dr@openoffice.org> | 2010-07-07 19:27:51 +0200 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2010-07-07 19:27:51 +0200 |
commit | 4232a54805f36dcfcb05b980ac9b6df2ed381fef (patch) | |
tree | f524e0a6342a18c08d848fe311fdd8b09d0c6132 /oox/source/core/filterbase.cxx | |
parent | 19d399fdda8f8e2b124e00bff54ecea476a3592e (diff) |
mib17: remove unused code
Diffstat (limited to 'oox/source/core/filterbase.cxx')
-rw-r--r--[-rwxr-xr-x] | oox/source/core/filterbase.cxx | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 902784cafe80..dfa898026dd8 100755..100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -74,8 +74,18 @@ namespace core { namespace { +struct UrlPool +{ + ::osl::Mutex maMutex; + ::std::set< OUString > maUrls; +}; + +struct StaticUrlPool : public ::rtl::Static< UrlPool, StaticUrlPool > {}; + +// ---------------------------------------------------------------------------- + /** This guard prevents recursive loading/saving of the same document. */ -class DocumentOpenedGuard : public ::osl::Mutex +class DocumentOpenedGuard { public: explicit DocumentOpenedGuard( const OUString& rUrl ); @@ -87,31 +97,28 @@ private: DocumentOpenedGuard( const DocumentOpenedGuard& ); DocumentOpenedGuard& operator=( const DocumentOpenedGuard& ); - typedef ::std::set< OUString > UrlSet; - struct UrlPool : public ::rtl::Static< UrlSet, UrlPool > {}; - - UrlSet& mrUrls; OUString maUrl; bool mbValid; }; -DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl ) : - mrUrls( UrlPool::get() ) +DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl ) { - ::osl::MutexGuard aGuard( *this ); - mbValid = (rUrl.getLength() == 0) || (mrUrls.count( rUrl ) == 0); + UrlPool& rUrlPool = StaticUrlPool::get(); + ::osl::MutexGuard aGuard( rUrlPool.maMutex ); + mbValid = (rUrl.getLength() == 0) || (rUrlPool.maUrls.count( rUrl ) == 0); if( mbValid && (rUrl.getLength() > 0) ) { - mrUrls.insert( rUrl ); + rUrlPool.maUrls.insert( rUrl ); maUrl = rUrl; } } DocumentOpenedGuard::~DocumentOpenedGuard() { - ::osl::MutexGuard aGuard( *this ); + UrlPool& rUrlPool = StaticUrlPool::get(); + ::osl::MutexGuard aGuard( rUrlPool.maMutex ); if( maUrl.getLength() > 0 ) - mrUrls.erase( maUrl ); + rUrlPool.maUrls.erase( maUrl ); } } // namespace @@ -594,4 +601,3 @@ GraphicHelper* FilterBase::implCreateGraphicHelper() const } // namespace core } // namespace oox - |