diff options
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/parser/cxfa_dataexporter.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/xfa/fxfa/parser/cxfa_dataexporter.cpp b/xfa/fxfa/parser/cxfa_dataexporter.cpp index 70748f2666..dda93a36fc 100644 --- a/xfa/fxfa/parser/cxfa_dataexporter.cpp +++ b/xfa/fxfa/parser/cxfa_dataexporter.cpp @@ -49,25 +49,9 @@ CFX_WideString ExportEncodeAttribute(const CFX_WideString& str) { return textBuf.MakeString(); } -const uint16_t g_XMLValidCharRange[][2] = {{0x09, 0x09}, - {0x0A, 0x0A}, - {0x0D, 0x0D}, - {0x20, 0xD7FF}, - {0xE000, 0xFFFD}}; bool IsXMLValidChar(wchar_t ch) { - int32_t iStart = 0; - int32_t iEnd = FX_ArraySize(g_XMLValidCharRange) - 1; - while (iStart <= iEnd) { - int32_t iMid = (iStart + iEnd) / 2; - if (ch < g_XMLValidCharRange[iMid][0]) { - iEnd = iMid - 1; - } else if (ch > g_XMLValidCharRange[iMid][1]) { - iStart = iMid + 1; - } else { - return true; - } - } - return false; + return ch == 0x09 || ch == 0x0A || ch == 0x0D || + (ch >= 0x20 && ch <= 0xD7FF) || (ch >= 0xE000 && ch <= 0xFFFD); } CFX_WideString ExportEncodeContent(const CFX_WideStringC& str) { |