Merge pull request #1008 from ONLYOFFICE/fix/bug58584

Fix bug 58584
This commit is contained in:
Oleg Korshul
2022-08-24 11:09:30 +03:00
committed by GitHub
2 changed files with 13 additions and 5 deletions

View File

@ -435,8 +435,9 @@ namespace NSCSS
{
std::map<StatistickElement, unsigned int>::const_iterator oFindCountId = m_mStatictics->find(StatistickElement{StatistickElement::IsId, sId});
if (((bIsSettings && oFindCountId->second < MaxNumberRepetitions) ||
(!bIsSettings && oFindCountId->second >= MaxNumberRepetitions)))
if ((m_mStatictics->end() != oFindCountId) &&
(((bIsSettings && oFindCountId->second < MaxNumberRepetitions) ||
(!bIsSettings && oFindCountId->second >= MaxNumberRepetitions))))
{
if (!oFindId->second->Empty())
arFindElements.push_back(oFindId->second);

View File

@ -454,8 +454,7 @@ public:
std::string xml_string = XmlUtils::GetUtf8FromFileContent(buffer, dwReadBytes);
bool bRes = false;
if ((std::string::npos != xml_string.find("Content-Type: multipart/related")) &&
(std::string::npos != xml_string.find("Content-Type: text/html")))
if (std::string::npos != xml_string.find("Content-Type: multipart/related"))
{
BYTE* pData;
DWORD nLength;
@ -464,7 +463,15 @@ public:
std::string sFileContent = XmlUtils::GetUtf8FromFileContent(pData, nLength);
RELEASEARRAYOBJECTS(pData);
/*
std::wstring sRes = mhtToXhtml(sFileContent);
NSFile::CFileBinary oWriter;
if (oWriter.CreateFileW(m_sTmp + L"/res.html"))
{
oWriter.WriteStringUTF8(sRes);
oWriter.CloseFile();
}
*/
bRes = m_oLightReader.FromString(mhtToXhtml(sFileContent));
}
else