// CXmlFormItem_Static.cpp
//
#include "stdafx.h"
#include "XmlFormItem_Static.h"
CXmlFormItem_Static::CXmlFormItem_Static()
{}
CXmlFormItem_Static::~CXmlFormItem_Static()
{}
bool CXmlFormItem_Static::BuildFromXml(CXMLDOMNode& node)
{
USES_CONVERSION;
CXMLDOMNode childNode;
CXMLDOMNodeList children;
std::string nodeName;
children = node.GetChildNodes();
for (long i = 0; i < children.GetLength(); i++) {
childNode = children.GetItem(i);
nodeName = childNode.GetNodeName();
if (nodeName == "formItem") {
CXmlBaseFormItem::BuildFromXml(childNode);
} else if (nodeName == "caption") {
caption_ = W2A(childNode.GetNodeTypedValue().bstrVal);
}
}
return true;
}
bool CXmlFormItem_Static::AppendToDOMDocument(CXMLDOMDocument2& xmlDoc, CXMLDOMElement& parentElement, bool parentIsValid)
{
CXMLDOMElement newElement;
CXMLDOMElement rectElement;
CXMLDOMElement member;
newElement = xmlDoc.CreateElement(GetXmlNodeName().c_str());
CXmlBaseFormItem::AppendToDOMDocument(xmlDoc, newElement, parentIsValid);
AppendMemberNode("caption", caption_, newElement, xmlDoc);
parentElement.AppendChild(newElement);
return true;
}
void CXmlFormItem_Static::SetCaption(const string& caption)
{
caption_ = caption;
}
string CXmlFormItem_Static::GetCaption()
{
return caption_;
}
enFormItemType CXmlFormItem_Static::GetItemType()
{
return enFormItemType_Static;
}
void CXmlFormItem_Static::Clear()
{}
void CXmlFormItem_Static::SetDefaults()
{}