diff options
author | Lei Zhang <thestig@chromium.org> | 2018-08-13 19:56:29 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-13 19:56:29 +0000 |
commit | 30029419ad4b9e5cd382767a8645677afbeff7fd (patch) | |
tree | 1b932ad14e5acf12aefdeeebac856ca8f5d89bfa /xfa/fxfa/parser/cxfa_document_parser.cpp | |
parent | 1a99f200c59a89fe297ac79658d2fe11b13b1553 (diff) | |
download | pdfium-30029419ad4b9e5cd382767a8645677afbeff7fd.tar.xz |
Use CFX_ReadOnlyMemoryStream in more places.
More const pointers, less const_casts.
BUG=pdfium:263
Change-Id: I47fc6d8f2f837390e40ad22d8b67946065294eaa
Reviewed-on: https://pdfium-review.googlesource.com/39879
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_document_parser.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_document_parser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp index 96c031079b..5cb08863c8 100644 --- a/xfa/fxfa/parser/cxfa_document_parser.cpp +++ b/xfa/fxfa/parser/cxfa_document_parser.cpp @@ -10,7 +10,7 @@ #include <vector> #include "core/fxcrt/autorestorer.h" -#include "core/fxcrt/cfx_memorystream.h" +#include "core/fxcrt/cfx_readonlymemorystream.h" #include "core/fxcrt/cfx_widetextbuf.h" #include "core/fxcrt/fx_codepage.h" #include "core/fxcrt/fx_extension.h" @@ -332,8 +332,8 @@ bool CXFA_DocumentParser::Parse( } CFX_XMLNode* CXFA_DocumentParser::ParseXMLData(const ByteString& wsXML) { - auto pStream = pdfium::MakeRetain<CFX_MemoryStream>( - const_cast<uint8_t*>(wsXML.raw_str()), wsXML.GetLength(), false); + auto pStream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>( + wsXML.raw_str(), wsXML.GetLength()); xml_doc_ = LoadXML(pStream); if (!xml_doc_) return nullptr; |