From 7b36672405c05037709a7ba3e8cc96efe2471408 Mon Sep 17 00:00:00 2001 From: tsepez Date: Sat, 3 Sep 2016 17:10:13 -0700 Subject: Use safe bool conversion operators in fpdf_page/ Review-Url: https://codereview.chromium.org/2310693002 --- core/fpdfapi/fpdf_page/cpdf_colorstate.h | 2 +- core/fpdfapi/fpdf_page/cpdf_contentmark.h | 2 +- core/fpdfapi/fpdf_page/include/cpdf_generalstate.h | 2 +- core/fpdfapi/fpdf_page/include/cpdf_path.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.h b/core/fpdfapi/fpdf_page/cpdf_colorstate.h index d928dbdb2e..a4077d965f 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.h +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.h @@ -51,7 +51,7 @@ class CPDF_ColorState { // TODO(tsepez): Stop leaking ColorStateData outside this class. const CPDF_ColorStateData* GetObject() const { return m_Ref.GetObject(); } - operator bool() const { return !!m_Ref; } + explicit operator bool() const { return !!m_Ref; } private: void SetColor(CPDF_Color& color, diff --git a/core/fpdfapi/fpdf_page/cpdf_contentmark.h b/core/fpdfapi/fpdf_page/cpdf_contentmark.h index 2941c61ba9..25da5889df 100644 --- a/core/fpdfapi/fpdf_page/cpdf_contentmark.h +++ b/core/fpdfapi/fpdf_page/cpdf_contentmark.h @@ -30,7 +30,7 @@ class CPDF_ContentMark { FX_BOOL bDirect); void DeleteLastMark(); - operator bool() const { return !!m_Ref; } + explicit operator bool() const { return !!m_Ref; } private: CFX_CountRef m_Ref; diff --git a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h index f07e411973..1cd2d815c8 100644 --- a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h +++ b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h @@ -21,7 +21,7 @@ class CPDF_GeneralState { ~CPDF_GeneralState(); void Emplace() { m_Ref.Emplace(); } - operator bool() const { return !!m_Ref; } + explicit operator bool() const { return !!m_Ref; } void SetRenderIntent(const CFX_ByteString& ri); diff --git a/core/fpdfapi/fpdf_page/include/cpdf_path.h b/core/fpdfapi/fpdf_page/include/cpdf_path.h index a9b0a7fac0..ae98531214 100644 --- a/core/fpdfapi/fpdf_page/include/cpdf_path.h +++ b/core/fpdfapi/fpdf_page/include/cpdf_path.h @@ -20,7 +20,7 @@ class CPDF_Path { ~CPDF_Path(); void Emplace() { m_Ref.Emplace(); } - operator bool() const { return !!m_Ref; } + explicit operator bool() const { return !!m_Ref; } int GetPointCount() const; void SetPointCount(int count); -- cgit v1.2.3