mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Disable xml errors on check svg
This commit is contained in:
@ -5587,6 +5587,8 @@ namespace SVG
|
||||
return false;
|
||||
#endif
|
||||
|
||||
bool bRet = false;
|
||||
|
||||
if (model)
|
||||
{
|
||||
m_model = model;
|
||||
@ -5594,10 +5596,12 @@ namespace SVG
|
||||
std::wstring sXml;
|
||||
NSFile::CFileBinary::ReadAllTextUtf8(strFile, sXml);
|
||||
|
||||
return LoadFromString(sXml, model);
|
||||
XmlUtils::IXmlDOMDocument::DisableOutput();
|
||||
bRet = LoadFromString(sXml, model);
|
||||
XmlUtils::IXmlDOMDocument::EnableOutput();
|
||||
}
|
||||
|
||||
return false;
|
||||
return bRet;
|
||||
}
|
||||
inline bool LoadFromString (const std::wstring& strXml, Storage* model)
|
||||
{
|
||||
|
||||
@ -143,6 +143,9 @@ namespace XmlUtils
|
||||
|
||||
virtual unsigned int AddRef();
|
||||
virtual unsigned int Release();
|
||||
|
||||
static void DisableOutput();
|
||||
static void EnableOutput();
|
||||
};
|
||||
|
||||
class CXmlNodeBase;
|
||||
|
||||
@ -34,6 +34,11 @@
|
||||
|
||||
namespace XmlUtils
|
||||
{
|
||||
static void libxml2_err_no(void * ctx, const char * msg, ...)
|
||||
{
|
||||
// none
|
||||
}
|
||||
|
||||
IXmlDOMDocument::IXmlDOMDocument()
|
||||
{
|
||||
m_lRef = 1;
|
||||
@ -54,6 +59,16 @@ namespace XmlUtils
|
||||
delete this;
|
||||
return lReturn;
|
||||
}
|
||||
|
||||
void IXmlDOMDocument::DisableOutput()
|
||||
{
|
||||
xmlSetGenericErrorFunc(NULL, (xmlGenericErrorFunc)libxml2_err_no);
|
||||
}
|
||||
|
||||
void IXmlDOMDocument::EnableOutput()
|
||||
{
|
||||
xmlSetGenericErrorFunc(NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
namespace XmlUtils
|
||||
|
||||
Reference in New Issue
Block a user