summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-04-13 15:44:36 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-13 15:44:36 +0000
commit996c93068bfc8b443c77b735bc6400285bc8a407 (patch)
tree13b6d18f62f15c4ba04edec3dd2349f7ae3c1d54 /core/fpdfapi/edit
parent7afdad5ab7a1bd54ddf6f2a823be30d4b8e39567 (diff)
downloadpdfium-996c93068bfc8b443c77b735bc6400285bc8a407.tar.xz
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 <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp18
1 files changed, 9 insertions, 9 deletions
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<float> 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<float> 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<float> 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<float> 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));