From 28bb2f2ffe751cf4142329e27238da52ae9f848b Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 3 Apr 2018 19:52:27 +0000 Subject: Remove DefaultAppearance HasColor and return an optional instead This CL converts CPDF_DefaultAppearance to return Optional items instead of having a HasColor. This saves the double parse of the appearance stream. Change-Id: Ib3c136da6e2adfb559e495de1d299cce0b4ad25f Reviewed-on: https://pdfium-review.googlesource.com/29630 Reviewed-by: Henrique Nakashima Commit-Queue: dsinclair --- core/fpdfdoc/cpdf_defaultappearance.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/fpdfdoc/cpdf_defaultappearance.h') diff --git a/core/fpdfdoc/cpdf_defaultappearance.h b/core/fpdfdoc/cpdf_defaultappearance.h index ae3c4f5517..73e35c7cd4 100644 --- a/core/fpdfdoc/cpdf_defaultappearance.h +++ b/core/fpdfdoc/cpdf_defaultappearance.h @@ -27,9 +27,8 @@ class CPDF_DefaultAppearance { Optional GetFont(float* fFontSize); - bool HasColor(); - CFX_Color::Type GetColor(float fc[4]); - std::pair GetColor(); + Optional GetColor(float fc[4]); + std::pair, FX_ARGB> GetColor(); bool FindTagParamFromStartForTesting(CPDF_SimpleParser* parser, const ByteStringView& token, -- cgit v1.2.3