commit | 7b36672405c05037709a7ba3e8cc96efe2471408 | [log] [tgz] |
---|---|---|
author | tsepez <tsepez@chromium.org> | Sat Sep 03 17:10:13 2016 -0700 |
committer | Commit bot <commit-bot@chromium.org> | Sat Sep 03 17:10:13 2016 -0700 |
tree | 8a7d7d9b27fcf11d97ae0c8b3630b0e586f81bf4 | |
parent | 738766eefaf14fabb168f1f5a5c987f8e7049cab [diff] |
Use safe bool conversion operators in fpdf_page/ Review-Url: https://codereview.chromium.org/2310693002
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.h b/core/fpdfapi/fpdf_page/cpdf_colorstate.h index d928dbd..a4077d9 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.h +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.h
@@ -51,7 +51,7 @@ // 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 2941c61..25da588 100644 --- a/core/fpdfapi/fpdf_page/cpdf_contentmark.h +++ b/core/fpdfapi/fpdf_page/cpdf_contentmark.h
@@ -30,7 +30,7 @@ FX_BOOL bDirect); void DeleteLastMark(); - operator bool() const { return !!m_Ref; } + explicit operator bool() const { return !!m_Ref; } private: CFX_CountRef<CPDF_ContentMarkData> m_Ref;
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h index f07e411..1cd2d81 100644 --- a/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h +++ b/core/fpdfapi/fpdf_page/include/cpdf_generalstate.h
@@ -21,7 +21,7 @@ ~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 a9b0a7f..ae98531 100644 --- a/core/fpdfapi/fpdf_page/include/cpdf_path.h +++ b/core/fpdfapi/fpdf_page/include/cpdf_path.h
@@ -20,7 +20,7 @@ ~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);