From 987f3ee94c3cb8e4a6113ad05453a2948469386c Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 26 Aug 2016 15:17:12 -0700 Subject: Make CFX_CountRef<>::m_pObject private, add accessors, fix const-ness. Hide the CountedObj class from the rest of the code. Rename GetModify() to GetPrivateCopy(), since it turns out there are places where we modify a potentially-shared copy. Add non-const version of GetObject() to permit these. Review-Url: https://codereview.chromium.org/2287633002 --- core/fpdfapi/fpdf_page/cpdf_colorstate.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/fpdfapi/fpdf_page/cpdf_colorstate.cpp') diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp index 1d422cb061..a2234378eb 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp @@ -13,14 +13,14 @@ void CPDF_ColorState::SetFillColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues) { - CPDF_ColorStateData* pData = GetModify(); + CPDF_ColorStateData* pData = GetPrivateCopy(); SetColor(pData->m_FillColor, pData->m_FillRGB, pCS, pValue, nValues); } void CPDF_ColorState::SetStrokeColor(CPDF_ColorSpace* pCS, FX_FLOAT* pValue, uint32_t nValues) { - CPDF_ColorStateData* pData = GetModify(); + CPDF_ColorStateData* pData = GetPrivateCopy(); SetColor(pData->m_StrokeColor, pData->m_StrokeRGB, pCS, pValue, nValues); } @@ -45,7 +45,7 @@ void CPDF_ColorState::SetColor(CPDF_Color& color, void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, uint32_t nValues) { - CPDF_ColorStateData* pData = GetModify(); + CPDF_ColorStateData* pData = GetPrivateCopy(); pData->m_FillColor.SetValue(pPattern, pValue, nValues); int R, G, B; FX_BOOL ret = pData->m_FillColor.GetRGB(R, G, B); @@ -61,7 +61,7 @@ void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern, void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern, FX_FLOAT* pValue, uint32_t nValues) { - CPDF_ColorStateData* pData = GetModify(); + CPDF_ColorStateData* pData = GetPrivateCopy(); pData->m_StrokeColor.SetValue(pPattern, pValue, nValues); int R, G, B; FX_BOOL ret = pData->m_StrokeColor.GetRGB(R, G, B); -- cgit v1.2.3