summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_variabletext.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-05-12 21:56:43 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-12 21:56:43 -0700
commit594b20b485046c954b68734e63e8d2c93fbe4ef5 (patch)
treec20f6447c239d49848fea421fd497f23e41edbe3 /core/fpdfdoc/cpdf_variabletext.cpp
parentf6d9a61af218b7acc1161ae231b16765ca10b526 (diff)
downloadpdfium-594b20b485046c954b68734e63e8d2c93fbe4ef5.tar.xz
Fix some misc nits.
These were left over from after I broke a big "things that never return NULL" CL up into smaller ones. Review-Url: https://codereview.chromium.org/1960043003
Diffstat (limited to 'core/fpdfdoc/cpdf_variabletext.cpp')
-rw-r--r--core/fpdfdoc/cpdf_variabletext.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 118efa6a10..a8b9c3c778 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -1112,9 +1112,8 @@ int32_t CPDF_VariableText::GetCharWidth(int32_t nFontIndex,
int32_t nWordStyle) {
if (!m_pVTProvider)
return 0;
- if (SubWord > 0)
- return m_pVTProvider->GetCharWidth(nFontIndex, SubWord, nWordStyle);
- return m_pVTProvider->GetCharWidth(nFontIndex, Word, nWordStyle);
+ uint16_t word = SubWord ? SubWord : Word;
+ return m_pVTProvider->GetCharWidth(nFontIndex, word, nWordStyle);
}
int32_t CPDF_VariableText::GetTypeAscent(int32_t nFontIndex) {