summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc/doc_vt.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-01 15:08:10 -0700
committerLei Zhang <thestig@chromium.org>2015-10-01 15:08:10 -0700
commit24a3b4ea99a40cc251b68561469b9099419adfe9 (patch)
tree17aaf6ab021ee43d1ba4f665b8047775dd303950 /core/src/fpdfdoc/doc_vt.cpp
parente95f39f10400746f0dc49c8afe3b3f21cdbbf381 (diff)
downloadpdfium-24a3b4ea99a40cc251b68561469b9099419adfe9.tar.xz
XFA: Remove tests for failures after new statements.
Manual merge of commit 357d16f8453c2cf0c0afd00eec9e86d03d55fe69. Original code review: https://codereview.chromium.org/1090693002 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1379683006 .
Diffstat (limited to 'core/src/fpdfdoc/doc_vt.cpp')
-rw-r--r--core/src/fpdfdoc/doc_vt.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp
index 480fce5c1e..396a7d6b71 100644
--- a/core/src/fpdfdoc/doc_vt.cpp
+++ b/core/src/fpdfdoc/doc_vt.cpp
@@ -69,14 +69,13 @@ void CSection::ResetLinePlace() {
}
CPVT_WordPlace CSection::AddWord(const CPVT_WordPlace& place,
const CPVT_WordInfo& wordinfo) {
- if (CPVT_WordInfo* pWord = new CPVT_WordInfo(wordinfo)) {
- int32_t nWordIndex =
- FPDF_MAX(FPDF_MIN(place.nWordIndex, m_WordArray.GetSize()), 0);
- if (nWordIndex == m_WordArray.GetSize()) {
- m_WordArray.Add(pWord);
- } else {
- m_WordArray.InsertAt(nWordIndex, pWord);
- }
+ CPVT_WordInfo* pWord = new CPVT_WordInfo(wordinfo);
+ int32_t nWordIndex =
+ FPDF_MAX(FPDF_MIN(place.nWordIndex, m_WordArray.GetSize()), 0);
+ if (nWordIndex == m_WordArray.GetSize()) {
+ m_WordArray.Add(pWord);
+ } else {
+ m_WordArray.InsertAt(nWordIndex, pWord);
}
return place;
}
@@ -1663,7 +1662,7 @@ FX_BOOL CPDF_VariableText::IsLatinWord(FX_WORD word) {
}
IPDF_VariableText_Iterator* CPDF_VariableText::GetIterator() {
if (!m_pVTIterator) {
- return m_pVTIterator = new CPDF_VariableText_Iterator(this);
+ m_pVTIterator = new CPDF_VariableText_Iterator(this);
}
return m_pVTIterator;
}