From 996c93068bfc8b443c77b735bc6400285bc8a407 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 13 Apr 2018 15:44:36 +0000 Subject: Rename the other CPDF_Color::SetValue() variant. Rename it to SetValueForNonePattern() and combine the components parameters into a std::vector. Fix the callers to use std::vector as well. Change-Id: I0edd7e7876e47b56821e63cc5073fc21fd4098ee Reviewed-on: https://pdfium-review.googlesource.com/30470 Commit-Queue: Lei Zhang Reviewed-by: Henrique Nakashima --- .../edit/cpdf_pagecontentgenerator_unittest.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/fpdfapi/edit') diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp index 403bd6ab03..e9b3d15d30 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp +++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp @@ -117,12 +117,12 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessGraphics) { pPathObj->m_FillType = FXFILL_WINDING; pPathObj->m_bStroke = true; - float rgb[3] = {0.5f, 0.7f, 0.35f}; + static const std::vector rgb = {0.5f, 0.7f, 0.35f}; CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB); - pPathObj->m_ColorState.SetFillColor(pCS, rgb, 3); + pPathObj->m_ColorState.SetFillColor(pCS, rgb); - float rgb2[3] = {1, 0.9f, 0}; - pPathObj->m_ColorState.SetStrokeColor(pCS, rgb2, 3); + static const std::vector rgb2 = {1, 0.9f, 0}; + pPathObj->m_ColorState.SetStrokeColor(pCS, rgb2); pPathObj->m_GeneralState.SetFillAlpha(0.5f); pPathObj->m_GeneralState.SetStrokeAlpha(0.8f); @@ -140,7 +140,7 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessGraphics) { pathString.Left(48)); EXPECT_EQ(" gs 1 0 0 1 0 0 cm 1 2 m 3 4 l 5 6 l h B Q\n", pathString.Right(43)); - ASSERT_TRUE(pathString.GetLength() > 91); + ASSERT_GT(pathString.GetLength(), 91U); CPDF_Dictionary* externalGS = TestGetResource( &generator, "ExtGState", pathString.Mid(48, pathString.GetLength() - 91)); ASSERT_TRUE(externalGS); @@ -174,12 +174,12 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessStandardText) { CPDF_Font* pFont = CPDF_Font::GetStockFont(pDoc.get(), "Times-Roman"); pTextObj->m_TextState.SetFont(pFont); pTextObj->m_TextState.SetFontSize(10.0f); - float rgb[3] = {0.5f, 0.7f, 0.35f}; + static const std::vector rgb = {0.5f, 0.7f, 0.35f}; CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB); - pTextObj->m_ColorState.SetFillColor(pCS, rgb, 3); + pTextObj->m_ColorState.SetFillColor(pCS, rgb); - float rgb2[3] = {1, 0.9f, 0}; - pTextObj->m_ColorState.SetStrokeColor(pCS, rgb2, 3); + static const std::vector rgb2 = {1, 0.9f, 0}; + pTextObj->m_ColorState.SetStrokeColor(pCS, rgb2); pTextObj->m_GeneralState.SetFillAlpha(0.5f); pTextObj->m_GeneralState.SetStrokeAlpha(0.8f); pTextObj->Transform(CFX_Matrix(1, 0, 0, 1, 100, 100)); -- cgit v1.2.3