Change xml properties to attributes in xtixml.cpp
Probably a follow-up fix for commit from 10 years ago: 288b610
This fixes compilation with `--enable-extended_rtti` configure flag.
Also removed all trailing spaces in this file.
This commit is contained in:
@@ -98,7 +98,7 @@ void wxObjectXmlWriter::DoBeginWriteTopLevelEntry( const wxString &name )
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("entry"));
|
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("entry"));
|
||||||
pnode->AddProperty(wxString(wxT("name")), name);
|
pnode->AddAttribute(wxString(wxT("name")), name);
|
||||||
m_data->m_current->AddChild(pnode);
|
m_data->m_current->AddChild(pnode);
|
||||||
m_data->Push( pnode );
|
m_data->Push( pnode );
|
||||||
}
|
}
|
||||||
@@ -108,27 +108,27 @@ void wxObjectXmlWriter::DoEndWriteTopLevelEntry( const wxString &WXUNUSED(name)
|
|||||||
m_data->Pop();
|
m_data->Pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxObjectXmlWriter::DoBeginWriteObject(const wxObject *WXUNUSED(object),
|
void wxObjectXmlWriter::DoBeginWriteObject(const wxObject *WXUNUSED(object),
|
||||||
const wxClassInfo *classInfo,
|
const wxClassInfo *classInfo,
|
||||||
int objectID, const wxStringToAnyHashMap &metadata )
|
int objectID, const wxStringToAnyHashMap &metadata )
|
||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
||||||
pnode->AddProperty(wxT("class"), wxString(classInfo->GetClassName()));
|
pnode->AddAttribute(wxT("class"), wxString(classInfo->GetClassName()));
|
||||||
pnode->AddProperty(wxT("id"), wxString::Format( wxT("%d"), objectID ) );
|
pnode->AddAttribute(wxT("id"), wxString::Format( wxT("%d"), objectID ) );
|
||||||
|
|
||||||
wxStringToAnyHashMap::const_iterator it, en;
|
wxStringToAnyHashMap::const_iterator it, en;
|
||||||
for( it = metadata.begin(), en = metadata.end(); it != en; ++it )
|
for( it = metadata.begin(), en = metadata.end(); it != en; ++it )
|
||||||
{
|
{
|
||||||
pnode->AddProperty( it->first, wxAnyGetAsString(it->second) );
|
pnode->AddAttribute( it->first, wxAnyGetAsString(it->second) );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_data->m_current->AddChild(pnode);
|
m_data->m_current->AddChild(pnode);
|
||||||
m_data->Push( pnode );
|
m_data->Push( pnode );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxObjectXmlWriter::DoEndWriteObject(const wxObject *WXUNUSED(object),
|
void wxObjectXmlWriter::DoEndWriteObject(const wxObject *WXUNUSED(object),
|
||||||
const wxClassInfo *WXUNUSED(classInfo),
|
const wxClassInfo *WXUNUSED(classInfo),
|
||||||
int WXUNUSED(objectID) )
|
int WXUNUSED(objectID) )
|
||||||
{
|
{
|
||||||
m_data->Pop();
|
m_data->Pop();
|
||||||
@@ -156,7 +156,7 @@ void wxObjectXmlWriter::DoBeginWriteProperty(const wxPropertyInfo *pi )
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("prop") );
|
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("prop") );
|
||||||
pnode->AddProperty(wxT("name"), pi->GetName() );
|
pnode->AddAttribute(wxT("name"), pi->GetName() );
|
||||||
m_data->m_current->AddChild(pnode);
|
m_data->m_current->AddChild(pnode);
|
||||||
m_data->Push( pnode );
|
m_data->Push( pnode );
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ void wxObjectXmlWriter::DoWriteRepeatedObject( int objectID )
|
|||||||
{
|
{
|
||||||
wxXmlNode *pnode;
|
wxXmlNode *pnode;
|
||||||
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
pnode = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("object"));
|
||||||
pnode->AddProperty(wxString(wxT("href")), wxString::Format( wxT("%d"), objectID ) );
|
pnode->AddAttribute(wxString(wxT("href")), wxString::Format( wxT("%d"), objectID ) );
|
||||||
m_data->m_current->AddChild(pnode);
|
m_data->m_current->AddChild(pnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,11 +181,11 @@ void wxObjectXmlWriter::DoWriteNullObject()
|
|||||||
m_data->m_current->AddChild(pnode);
|
m_data->m_current->AddChild(pnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxObjectXmlWriter::DoWriteDelegate( const wxObject *WXUNUSED(object),
|
void wxObjectXmlWriter::DoWriteDelegate( const wxObject *WXUNUSED(object),
|
||||||
const wxClassInfo* WXUNUSED(classInfo),
|
const wxClassInfo* WXUNUSED(classInfo),
|
||||||
const wxPropertyInfo *WXUNUSED(pi),
|
const wxPropertyInfo *WXUNUSED(pi),
|
||||||
const wxObject *eventSink, int sinkObjectID,
|
const wxObject *eventSink, int sinkObjectID,
|
||||||
const wxClassInfo* WXUNUSED(eventSinkClassInfo),
|
const wxClassInfo* WXUNUSED(eventSinkClassInfo),
|
||||||
const wxHandlerInfo* handlerInfo )
|
const wxHandlerInfo* handlerInfo )
|
||||||
{
|
{
|
||||||
if ( eventSink != NULL && handlerInfo != NULL )
|
if ( eventSink != NULL && handlerInfo != NULL )
|
||||||
@@ -279,10 +279,10 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
SetObjectClassInfo( objectID, classInfo );
|
SetObjectClassInfo( objectID, classInfo );
|
||||||
|
|
||||||
wxStringToAnyHashMap metadata;
|
wxStringToAnyHashMap metadata;
|
||||||
wxXmlProperty *xp = node->GetAttributes();
|
wxXmlAttribute *xp = node->GetAttributes();
|
||||||
while ( xp )
|
while ( xp )
|
||||||
{
|
{
|
||||||
if ( xp->GetName() != wxString(wxT("class")) &&
|
if ( xp->GetName() != wxString(wxT("class")) &&
|
||||||
xp->GetName() != wxString(wxT("id")) )
|
xp->GetName() != wxString(wxT("id")) )
|
||||||
{
|
{
|
||||||
metadata[xp->GetName()] = wxAny( xp->GetValue() );
|
metadata[xp->GetName()] = wxAny( xp->GetValue() );
|
||||||
@@ -334,7 +334,7 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
if ( pi->GetTypeInfo()->IsObjectType() )
|
if ( pi->GetTypeInfo()->IsObjectType() )
|
||||||
{
|
{
|
||||||
createParamOids[i] = ReadComponent( prop, callbacks );
|
createParamOids[i] = ReadComponent( prop, callbacks );
|
||||||
createClassInfos[i] =
|
createClassInfos[i] =
|
||||||
wx_dynamic_cast(const wxClassTypeInfo*, pi->GetTypeInfo())->GetClassInfo();
|
wx_dynamic_cast(const wxClassTypeInfo*, pi->GetTypeInfo())->GetClassInfo();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -343,7 +343,7 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
createParams[i] = ReadValue( prop, pi->GetTypeInfo() );
|
createParams[i] = ReadValue( prop, pi->GetTypeInfo() );
|
||||||
if( pi->GetFlags() & wxPROP_ENUM_STORE_LONG )
|
if( pi->GetFlags() & wxPROP_ENUM_STORE_LONG )
|
||||||
{
|
{
|
||||||
const wxEnumTypeInfo *eti =
|
const wxEnumTypeInfo *eti =
|
||||||
wx_dynamic_cast(const wxEnumTypeInfo*, pi->GetTypeInfo() );
|
wx_dynamic_cast(const wxEnumTypeInfo*, pi->GetTypeInfo() );
|
||||||
if ( eti )
|
if ( eti )
|
||||||
{
|
{
|
||||||
@@ -373,7 +373,7 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
if ( pi->GetTypeInfo()->IsObjectType() )
|
if ( pi->GetTypeInfo()->IsObjectType() )
|
||||||
{
|
{
|
||||||
createParamOids[i] = wxNullObjectID;
|
createParamOids[i] = wxNullObjectID;
|
||||||
createClassInfos[i] =
|
createClassInfos[i] =
|
||||||
wx_dynamic_cast(const wxClassTypeInfo*, pi->GetTypeInfo())->GetClassInfo();
|
wx_dynamic_cast(const wxClassTypeInfo*, pi->GetTypeInfo())->GetClassInfo();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -394,7 +394,7 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
classInfo->GetCreateParamCount(),
|
classInfo->GetCreateParamCount(),
|
||||||
createParams, createParamOids, createClassInfos, metadata );
|
createParams, createParamOids, createClassInfos, metadata );
|
||||||
|
|
||||||
// now stream in the rest of the properties, in the sequence their
|
// now stream in the rest of the properties, in the sequence their
|
||||||
// properties were written in the xml
|
// properties were written in the xml
|
||||||
for ( size_t j = 0; j < propertyNames.size(); ++j )
|
for ( size_t j = 0; j < propertyNames.size(); ++j )
|
||||||
{
|
{
|
||||||
@@ -404,11 +404,11 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
if ( propiter != propertyNodes.end() )
|
if ( propiter != propertyNodes.end() )
|
||||||
{
|
{
|
||||||
wxXmlNode* prop = propiter->second;
|
wxXmlNode* prop = propiter->second;
|
||||||
const wxPropertyInfo* pi =
|
const wxPropertyInfo* pi =
|
||||||
classInfo->FindPropertyInfo( propertyNames[j].c_str() );
|
classInfo->FindPropertyInfo( propertyNames[j].c_str() );
|
||||||
if ( pi->GetTypeInfo()->GetKind() == wxT_COLLECTION )
|
if ( pi->GetTypeInfo()->GetKind() == wxT_COLLECTION )
|
||||||
{
|
{
|
||||||
const wxCollectionTypeInfo* collType =
|
const wxCollectionTypeInfo* collType =
|
||||||
wx_dynamic_cast( const wxCollectionTypeInfo*, pi->GetTypeInfo() );
|
wx_dynamic_cast( const wxCollectionTypeInfo*, pi->GetTypeInfo() );
|
||||||
const wxTypeInfo * elementType = collType->GetElementType();
|
const wxTypeInfo * elementType = collType->GetElementType();
|
||||||
while( prop )
|
while( prop )
|
||||||
@@ -496,7 +496,7 @@ int wxObjectXmlReader::ReadComponent(wxXmlNode *node, wxObjectReaderCallback *ca
|
|||||||
wxAny nodeval = ReadValue( prop, pi->GetTypeInfo() );
|
wxAny nodeval = ReadValue( prop, pi->GetTypeInfo() );
|
||||||
if( pi->GetFlags() & wxPROP_ENUM_STORE_LONG )
|
if( pi->GetFlags() & wxPROP_ENUM_STORE_LONG )
|
||||||
{
|
{
|
||||||
const wxEnumTypeInfo *eti =
|
const wxEnumTypeInfo *eti =
|
||||||
wx_dynamic_cast(const wxEnumTypeInfo*, pi->GetTypeInfo() );
|
wx_dynamic_cast(const wxEnumTypeInfo*, pi->GetTypeInfo() );
|
||||||
if ( eti )
|
if ( eti )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user