Kaydet (Commit) 2ea45a40 authored tarafından Michael Stahl's avatar Michael Stahl

tdf#93240: replace boost::ptr_map with std::map<std::unique_ptr>

Change-Id: I7bc614dc45154c8dd5a7d3948f2129e5127876b3
üst 395e6776
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <o3tl/ptr_container.hxx>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/languagetag.hxx>
#include <svtools/ctrltool.hxx> #include <svtools/ctrltool.hxx>
...@@ -772,26 +771,26 @@ void SvxCSS1Parser::InsertId( const OUString& rId, ...@@ -772,26 +771,26 @@ void SvxCSS1Parser::InsertId( const OUString& rId,
const SfxItemSet& rItemSet, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp ) const SvxCSS1PropertyInfo& rProp )
{ {
InsertMapEntry( rId, rItemSet, rProp, aIds ); InsertMapEntry( rId, rItemSet, rProp, m_Ids );
} }
const SvxCSS1MapEntry* SvxCSS1Parser::GetId( const OUString& rId ) const const SvxCSS1MapEntry* SvxCSS1Parser::GetId( const OUString& rId ) const
{ {
CSS1Map::const_iterator itr = aIds.find(rId); CSS1Map::const_iterator itr = m_Ids.find(rId);
return itr == aIds.end() ? NULL : itr->second; return itr == m_Ids.end() ? nullptr : itr->second.get();
} }
void SvxCSS1Parser::InsertClass( const OUString& rClass, void SvxCSS1Parser::InsertClass( const OUString& rClass,
const SfxItemSet& rItemSet, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp ) const SvxCSS1PropertyInfo& rProp )
{ {
InsertMapEntry( rClass, rItemSet, rProp, aClasses ); InsertMapEntry( rClass, rItemSet, rProp, m_Classes );
} }
const SvxCSS1MapEntry* SvxCSS1Parser::GetClass( const OUString& rClass ) const const SvxCSS1MapEntry* SvxCSS1Parser::GetClass( const OUString& rClass ) const
{ {
CSS1Map::const_iterator itr = aClasses.find(rClass); CSS1Map::const_iterator itr = m_Classes.find(rClass);
return itr == aClasses.end() ? NULL : itr->second; return itr == m_Classes.end() ? nullptr : itr->second.get();
} }
void SvxCSS1Parser::InsertPage( const OUString& rPage, void SvxCSS1Parser::InsertPage( const OUString& rPage,
...@@ -802,7 +801,7 @@ void SvxCSS1Parser::InsertPage( const OUString& rPage, ...@@ -802,7 +801,7 @@ void SvxCSS1Parser::InsertPage( const OUString& rPage,
OUString aKey( rPage ); OUString aKey( rPage );
if( bPseudo ) if( bPseudo )
aKey = ":" + aKey; aKey = ":" + aKey;
InsertMapEntry( aKey, rItemSet, rProp, aPages ); InsertMapEntry( aKey, rItemSet, rProp, m_Pages );
} }
SvxCSS1MapEntry* SvxCSS1Parser::GetPage( const OUString& rPage, bool bPseudo ) SvxCSS1MapEntry* SvxCSS1Parser::GetPage( const OUString& rPage, bool bPseudo )
...@@ -811,21 +810,21 @@ SvxCSS1MapEntry* SvxCSS1Parser::GetPage( const OUString& rPage, bool bPseudo ) ...@@ -811,21 +810,21 @@ SvxCSS1MapEntry* SvxCSS1Parser::GetPage( const OUString& rPage, bool bPseudo )
if( bPseudo ) if( bPseudo )
aKey = ":" + aKey; aKey = ":" + aKey;
CSS1Map::iterator itr = aPages.find(aKey); CSS1Map::iterator itr = m_Pages.find(aKey);
return itr == aPages.end() ? NULL : itr->second; return itr == m_Pages.end() ? nullptr : itr->second.get();
} }
void SvxCSS1Parser::InsertTag( const OUString& rTag, void SvxCSS1Parser::InsertTag( const OUString& rTag,
const SfxItemSet& rItemSet, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp ) const SvxCSS1PropertyInfo& rProp )
{ {
InsertMapEntry( rTag, rItemSet, rProp, aTags ); InsertMapEntry( rTag, rItemSet, rProp, m_Tags );
} }
SvxCSS1MapEntry* SvxCSS1Parser::GetTag( const OUString& rTag ) SvxCSS1MapEntry* SvxCSS1Parser::GetTag( const OUString& rTag )
{ {
CSS1Map::iterator itr = aTags.find(rTag); CSS1Map::iterator itr = m_Tags.find(rTag);
return itr == aTags.end() ? NULL : itr->second; return itr == m_Tags.end() ? nullptr : itr->second.get();
} }
bool SvxCSS1Parser::ParseStyleSheet( const OUString& rIn ) bool SvxCSS1Parser::ParseStyleSheet( const OUString& rIn )
...@@ -930,11 +929,11 @@ void SvxCSS1Parser::InsertMapEntry( const OUString& rKey, ...@@ -930,11 +929,11 @@ void SvxCSS1Parser::InsertMapEntry( const OUString& rKey,
if (itr == rMap.end()) if (itr == rMap.end())
{ {
std::unique_ptr<SvxCSS1MapEntry> p(new SvxCSS1MapEntry(rKey, rItemSet, rProp)); std::unique_ptr<SvxCSS1MapEntry> p(new SvxCSS1MapEntry(rKey, rItemSet, rProp));
o3tl::ptr_container::insert(rMap, rKey, std::move(p)); rMap.insert(std::make_pair(rKey, std::move(p)));
} }
else else
{ {
SvxCSS1MapEntry* p = itr->second; SvxCSS1MapEntry *const p = itr->second.get();
MergeStyles( rItemSet, rProp, MergeStyles( rItemSet, rProp,
p->GetItemSet(), p->GetPropertyInfo(), true ); p->GetItemSet(), p->GetPropertyInfo(), true );
} }
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include "parcss1.hxx" #include "parcss1.hxx"
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <memory>
#include <map>
class SfxItemPool; class SfxItemPool;
class SvxBoxItem; class SvxBoxItem;
...@@ -197,13 +199,13 @@ inline bool operator<( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 ) ...@@ -197,13 +199,13 @@ inline bool operator<( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 )
class SvxCSS1Parser : public CSS1Parser class SvxCSS1Parser : public CSS1Parser
{ {
typedef ::boost::ptr_vector<CSS1Selector> CSS1Selectors; typedef ::boost::ptr_vector<CSS1Selector> CSS1Selectors;
typedef ::boost::ptr_map<OUString, SvxCSS1MapEntry> CSS1Map; typedef ::std::map<OUString, std::unique_ptr<SvxCSS1MapEntry>> CSS1Map;
CSS1Selectors aSelectors; // Liste der "offenen" Selectoren CSS1Selectors aSelectors; // Liste der "offenen" Selectoren
CSS1Map aIds; CSS1Map m_Ids;
CSS1Map aClasses; CSS1Map m_Classes;
CSS1Map aPages; CSS1Map m_Pages;
CSS1Map aTags; CSS1Map m_Tags;
OUString sBaseURL; OUString sBaseURL;
......
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