rtftok: undo tryToSafelyUpdateAnExistingProp, will be back soon

Change-Id: I171dac32f8a938dc4ecfbab13835823f65ee2611
This commit is contained in:
Miklos Vajna 2012-05-30 15:25:39 +02:00
parent 7092be1a6f
commit f29892d974
5 changed files with 189 additions and 254 deletions

File diff suppressed because it is too large Load diff

View file

@ -48,9 +48,9 @@ RTFReferenceProperties::~RTFReferenceProperties()
void RTFReferenceProperties::resolve(Properties& rHandler)
{
for (RTFSprms::Iterator_t i = m_aAttributes.begin(); i != m_aAttributes.end(); ++i)
for (RTFSprms::Iterator_t i = m_aAttributes->begin(); i != m_aAttributes->end(); ++i)
rHandler.attribute(i->first, *i->second.get());
for (RTFSprms::Iterator_t i = m_aSprms.begin(); i != m_aSprms.end(); ++i)
for (RTFSprms::Iterator_t i = m_aSprms->begin(); i != m_aSprms->end(); ++i)
{
RTFSprm aSprm(i->first, i->second);
rHandler.sprm(aSprm);

View file

@ -107,12 +107,12 @@ void RTFSdrImport::resolve(RTFShape& rShape)
else if ( i->first == "wzName" )
{
RTFValue::Pointer_t pValue(new RTFValue(i->second));
m_rImport.getState().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_name, pValue));
m_rImport.getState().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_name, pValue));
}
else if ( i->first == "wzDescription" )
{
RTFValue::Pointer_t pValue(new RTFValue(i->second));
m_rImport.getState().aCharacterAttributes.push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_descr, pValue));
m_rImport.getState().aCharacterAttributes->push_back(make_pair(NS_ooxml::LN_CT_NonVisualDrawingProps_descr, pValue));
}
else if ( i->first == "pib" )
{

View file

@ -134,6 +134,11 @@ RTFSprms& RTFSprms::operator=(const RTFSprms& rOther)
return *this;
}
std::vector< std::pair<Id, RTFValue::Pointer_t> >* RTFSprms::operator->()
{
return &m_aSprms;
}
void RTFSprms::swap(RTFSprms& rOther)
{
m_aSprms.swap(rOther.m_aSprms);

View file

@ -38,24 +38,14 @@ namespace writerfilter {
{
public:
typedef ::boost::shared_ptr<RTFSprms> Pointer_t;
typedef std::pair<Id, RTFValue::Pointer_t> id_val;
typedef std::vector< id_val >::iterator Iterator_t;
typedef std::vector< id_val >::reverse_iterator ReverseIterator_t;
typedef std::vector< std::pair<Id, RTFValue::Pointer_t> >::iterator Iterator_t;
RTFSprms();
RTFSprms(const RTFSprms& rSprms);
RTFSprms& operator=(const RTFSprms& rOther);
std::vector< std::pair<Id, RTFValue::Pointer_t> >* operator->();
RTFValue::Pointer_t find(Id nKeyword);
bool erase(Id nKeyword);
void swap(RTFSprms& rOther);
size_t size() const { return m_aSprms.size(); }
bool empty() const { return m_aSprms.empty(); }
id_val& back() { return m_aSprms.back(); }
Iterator_t begin() { return m_aSprms.begin(); }
Iterator_t end() { return m_aSprms.end(); }
ReverseIterator_t rbegin() { return m_aSprms.rbegin(); }
ReverseIterator_t rend() { return m_aSprms.rend(); }
void push_back(id_val aVal) { m_aSprms.push_back(aVal); }
void clear() { return m_aSprms.clear(); }
private:
std::vector< std::pair<Id, RTFValue::Pointer_t> > m_aSprms;
};