summaryrefslogtreecommitdiff
path: root/xfa/fde/css/cfde_cssstylesheet.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-06-26 15:28:15 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-06-30 18:51:27 +0000
commitf3024c3b1fbbfe442f93da3459ea79e817d5b8fe (patch)
tree86652e7b9fc74c60bb966883d02ea14ca0d2995b /xfa/fde/css/cfde_cssstylesheet.cpp
parentd24236a926deeb8b9589c330c27dbd300b7f8c9d (diff)
downloadpdfium-f3024c3b1fbbfe442f93da3459ea79e817d5b8fe.tar.xz
Split CFDE_CSSTextBuf in two.
For the external buffer use case, use a CFDE_CSSExtTextBuf instead. With the split, both text buffer implementations are simpler now. As a result, it becomes obvious where it never fails. Adjust callers accordingly. Change-Id: I7b53d36593172487b8c939e6a55af2437ea4ee5a Reviewed-on: https://pdfium-review.googlesource.com/6932 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde/css/cfde_cssstylesheet.cpp')
-rw-r--r--xfa/fde/css/cfde_cssstylesheet.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/xfa/fde/css/cfde_cssstylesheet.cpp b/xfa/fde/css/cfde_cssstylesheet.cpp
index c16e25156c..369279853e 100644
--- a/xfa/fde/css/cfde_cssstylesheet.cpp
+++ b/xfa/fde/css/cfde_cssstylesheet.cpp
@@ -35,12 +35,10 @@ CFDE_CSSStyleRule* CFDE_CSSStyleSheet::GetRule(int32_t index) const {
}
bool CFDE_CSSStyleSheet::LoadBuffer(const wchar_t* pBuffer, int32_t iBufSize) {
- ASSERT(pBuffer && iBufSize > 0);
-
- auto pSyntax = pdfium::MakeUnique<CFDE_CSSSyntaxParser>();
- if (!pSyntax->Init(pBuffer, iBufSize))
- return false;
+ ASSERT(pBuffer);
+ ASSERT(iBufSize > 0);
+ auto pSyntax = pdfium::MakeUnique<CFDE_CSSSyntaxParser>(pBuffer, iBufSize);
Reset();
FDE_CSSSyntaxStatus eStatus;
do {