From cc4802edc4faee4bafae5219e94a5a22bfbb684b Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Wed, 20 Jun 2018 20:56:14 +0000 Subject: Fix a couple of CPDF_DefaultAppearance::GetFont usages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 853238 Change-Id: I133be340fd877e9acd2733845d454924dc86d295 Reviewed-on: https://pdfium-review.googlesource.com/35711 Reviewed-by: Henrique Nakashima Commit-Queue: Nicolás Peña Moreno --- fpdfsdk/formfiller/cba_fontmap.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/formfiller/cba_fontmap.cpp b/fpdfsdk/formfiller/cba_fontmap.cpp index d8d7dffd69..08a3021a73 100644 --- a/fpdfsdk/formfiller/cba_fontmap.cpp +++ b/fpdfsdk/formfiller/cba_fontmap.cpp @@ -218,12 +218,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(ByteString* sAlias) { CPDF_DefaultAppearance appearance(sDA); float font_size; Optional font = appearance.GetFont(&font_size); - if (font) { - ByteString sDecodedFontName = PDF_NameDecode(font->AsStringView()); - *sAlias = sDecodedFontName.Right(sDecodedFontName.GetLength() - 1); - } else { - *sAlias = ByteString(); - } + *sAlias = font.value_or(ByteString()); CPDF_Dictionary* pFontDict = nullptr; if (CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDictFor("AP")) { -- cgit v1.2.3