Commit b18cd44c authored by Oleg Korshul's avatar Oleg Korshul

.

parent 6705045d
...@@ -174,6 +174,9 @@ public: ...@@ -174,6 +174,9 @@ public:
return; return;
} }
std::wstring sSetupID = FindFirstChild(GetObjectById("idOfficeObject"), L"SetupID").GetText();
m_guid = U_TO_UTF8(sSetupID);
// 2) Check files (Manifect) // 2) Check files (Manifect)
XmlUtils::CXmlNode nodeManifect = GetObjectById("idPackageObject"); XmlUtils::CXmlNode nodeManifect = GetObjectById("idPackageObject");
if (!nodeManifect.IsValid()) if (!nodeManifect.IsValid())
...@@ -197,10 +200,10 @@ public: ...@@ -197,10 +200,10 @@ public:
// 3) Images // 3) Images
XmlUtils::CXmlNode nodeImageValid = GetObjectById("idValidSigLnImg"); XmlUtils::CXmlNode nodeImageValid = GetObjectById("idValidSigLnImg");
if (nodeImageValid.IsValid()) if (nodeImageValid.IsValid())
m_sImageValidBase64 = U_TO_UTF8(nodeImageValid.GetText()); m_sImageValidBase64 = GetBase64Image(nodeImageValid);
XmlUtils::CXmlNode nodeImageInvalid = GetObjectById("idInvalidSigLnImg"); XmlUtils::CXmlNode nodeImageInvalid = GetObjectById("idInvalidSigLnImg");
if (nodeImageInvalid.IsValid()) if (nodeImageInvalid.IsValid())
m_sImageInvalidBase64 = U_TO_UTF8(nodeImageInvalid.GetText()); m_sImageInvalidBase64 = GetBase64Image(nodeImageInvalid);
// 4) Objects // 4) Objects
XmlUtils::CXmlNodes nodesReferences; XmlUtils::CXmlNodes nodesReferences;
...@@ -262,6 +265,51 @@ public: ...@@ -262,6 +265,51 @@ public:
return ret; return ret;
} }
XmlUtils::CXmlNode FindFirstChild(XmlUtils::CXmlNode& node, const std::wstring& sName)
{
if (node.GetName() == sName)
return node;
XmlUtils::CXmlNodes childs;
if (node.GetChilds(childs))
{
int nCount = childs.GetCount();
for (int i = 0; i < nCount; i++)
{
XmlUtils::CXmlNode child;
childs.GetAt(i, child);
XmlUtils::CXmlNode ret = FindFirstChild(child, sName);
if (ret.IsValid())
return ret;
}
}
XmlUtils::CXmlNode ret;
return ret;
}
std::string GetBase64Image(XmlUtils::CXmlNode& node)
{
std::wstring sW = node.GetText();
std::string s = U_TO_UTF8(sW);
int len = (int)s.length();
int j = 0;
for (int i = 0; i < len;)
{
char c = s.at(i);
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || (c == '+') || (c == '/'))
s.at(j++) = s.at(i++);
else
i++;
}
s.resize(j);
return s;
}
friend class COOXMLVerifier; friend class COOXMLVerifier;
public: public:
......
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