diff options
author | Herbert Dürr <hdu@apache.org> | 2012-01-12 15:15:09 +0000 |
---|---|---|
committer | Herbert Dürr <hdu@apache.org> | 2012-01-12 15:15:09 +0000 |
commit | 40f7de3ea49a9ba691b58ab60bc34ce13ecd9461 (patch) | |
tree | e45f768eea711ae78259f91eee612509e1d5f8d6 | |
parent | 58e1851523a954099985b13d99be1df4f1ac6ab4 (diff) |
i118726 do not flush *pmap file while reading it
-rw-r--r-- | desktop/source/deployment/dp_persmap.cxx | 10 | ||||
-rw-r--r-- | desktop/source/deployment/inc/dp_persmap.h | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index 70ba2fc5ef34..8860819e32cf 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -205,7 +205,7 @@ bool PersistentMap::readAll() const OString aKeyName = decodeString( (sal_Char*)aKeyLine.getConstArray(), aKeyLine.getLength()); const OString aValName = decodeString( (sal_Char*)aValLine.getConstArray(), aValLine.getLength()); // insert key-value pair into map - put( aKeyName, aValName); + add( aKeyName, aValName); // check end-of-file status sal_Bool bIsEOF = true; if( m_MapFile.isEndOfFile( &bIsEOF) != osl::File::E_None) @@ -286,13 +286,19 @@ bool PersistentMap::get( OString * value, OString const & key ) const } //______________________________________________________________________________ -void PersistentMap::put( OString const & key, OString const & value ) +void PersistentMap::add( OString const & key, OString const & value ) { if( m_bReadOnly) return; typedef std::pair<t_string2string_map::iterator,bool> InsertRC; InsertRC r = m_entries.insert( t_string2string_map::value_type(key,value)); m_bIsDirty = r.second; +} + +//______________________________________________________________________________ +void PersistentMap::put( OString const & key, OString const & value ) +{ + add( key, value); // HACK: flush now as the extension manager does not seem // to properly destruct this object in some situations if( m_bIsDirty) diff --git a/desktop/source/deployment/inc/dp_persmap.h b/desktop/source/deployment/inc/dp_persmap.h index 4f0398c3c841..2ac06bdc4857 100644 --- a/desktop/source/deployment/inc/dp_persmap.h +++ b/desktop/source/deployment/inc/dp_persmap.h @@ -57,6 +57,7 @@ public: protected: bool open( void); bool readAll( void); + void add( ::rtl::OString const & key, ::rtl::OString const & value ); void flush( void); }; |