diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-24 18:38:57 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-24 18:38:57 +0000 |
commit | 1313ca08f7156898acf09e893e3f0e20d2d85424 (patch) | |
tree | fd1150556c7b289d990382cec3b60d9f9881742f /core/fpdfapi/edit | |
parent | f4f2b6d45e00c67a3c508618a829330a67b827ba (diff) | |
download | pdfium-1313ca08f7156898acf09e893e3f0e20d2d85424.tar.xz |
Make CPDF_PathObject::m_bStroke private.
Remove some setters on newly constructed objects, since |m_bStroke| is
already initialized to false.
Change-Id: I8d04efec997226fb86091566eea96604f18680aa
Reviewed-on: https://pdfium-review.googlesource.com/c/44511
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r-- | core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp | 6 | ||||
-rw-r--r-- | core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp | 6 |
2 files changed, 5 insertions, 7 deletions
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp index 1aca4bb8cf..a6a9412de4 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp @@ -395,11 +395,11 @@ void CPDF_PageContentGenerator::ProcessPath(std::ostringstream* buf, } } if (pPathObj->m_FillType == 0) - *buf << (pPathObj->m_bStroke ? " S" : " n"); + *buf << (pPathObj->stroke() ? " S" : " n"); else if (pPathObj->m_FillType == FXFILL_WINDING) - *buf << (pPathObj->m_bStroke ? " B" : " f"); + *buf << (pPathObj->stroke() ? " B" : " f"); else if (pPathObj->m_FillType == FXFILL_ALTERNATE) - *buf << (pPathObj->m_bStroke ? " B*" : " f*"); + *buf << (pPathObj->stroke() ? " B*" : " f*"); *buf << " Q\n"; } diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp index 249dd8ef0d..75fd0f62ff 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp +++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp @@ -53,7 +53,7 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessRect) { auto pPathObj = pdfium::MakeUnique<CPDF_PathObject>(); pPathObj->m_Path.AppendRect(10, 5, 13, 30); pPathObj->m_FillType = FXFILL_ALTERNATE; - pPathObj->m_bStroke = true; + pPathObj->set_stroke(true); auto pTestPage = pdfium::MakeRetain<CPDF_Page>(nullptr, nullptr, false); CPDF_PageContentGenerator generator(pTestPage.Get()); @@ -68,7 +68,6 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessRect) { false); pPathObj->m_Path.AppendPoint(CFX_PointF(0, 3.78f), FXPT_TYPE::LineTo, true); pPathObj->m_FillType = 0; - pPathObj->m_bStroke = false; buf.str(""); TestProcessPath(&generator, &buf, pPathObj.get()); @@ -97,7 +96,6 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessPath) { pPathObj->m_Path.AppendPoint(CFX_PointF(12, 13.64f), FXPT_TYPE::BezierTo, true); pPathObj->m_FillType = FXFILL_WINDING; - pPathObj->m_bStroke = false; auto pTestPage = pdfium::MakeRetain<CPDF_Page>(nullptr, nullptr, false); CPDF_PageContentGenerator generator(pTestPage.Get()); @@ -116,7 +114,7 @@ TEST_F(CPDF_PageContentGeneratorTest, ProcessGraphics) { pPathObj->m_Path.AppendPoint(CFX_PointF(3, 4), FXPT_TYPE::LineTo, false); pPathObj->m_Path.AppendPoint(CFX_PointF(5, 6), FXPT_TYPE::LineTo, true); pPathObj->m_FillType = FXFILL_WINDING; - pPathObj->m_bStroke = true; + pPathObj->set_stroke(true); static const std::vector<float> rgb = {0.5f, 0.7f, 0.35f}; CPDF_ColorSpace* pCS = CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB); |