summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_variabletext.cpp
diff options
context:
space:
mode:
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) {