diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-21 10:44:34 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-21 10:44:34 -0800 |
commit | ca6d98f4dfe7d4fc506b72c91f122f471a53c878 (patch) | |
tree | 869d681ce2f694eb5ffab7fbc8e163891bc23f31 /core | |
parent | f409da4b8a3e6a3885605a47bed4f8798c4703b9 (diff) | |
download | pdfium-ca6d98f4dfe7d4fc506b72c91f122f471a53c878.tar.xz |
Rename CPDF_PageContentGenerate to CPDF_PageContentGenerator.
Classes should be named after nouns, not verbs.
Also mark methods private, not protected.
R=ochang@chromium.org
Review URL: https://codereview.chromium.org/1611193003 .
Diffstat (limited to 'core')
-rw-r--r-- | core/include/fpdfapi/fpdf_page.h | 9 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp | 24 |
2 files changed, 16 insertions, 17 deletions
diff --git a/core/include/fpdfapi/fpdf_page.h b/core/include/fpdfapi/fpdf_page.h index d58537aa7e..edcef3c0b6 100644 --- a/core/include/fpdfapi/fpdf_page.h +++ b/core/include/fpdfapi/fpdf_page.h @@ -166,15 +166,15 @@ class CPDF_Form : public CPDF_PageObjects { CPDF_Form* Clone() const; }; -class CPDF_PageContentGenerate { +class CPDF_PageContentGenerator { public: - CPDF_PageContentGenerate(CPDF_Page* pPage); - ~CPDF_PageContentGenerate(); + CPDF_PageContentGenerator(CPDF_Page* pPage); + ~CPDF_PageContentGenerator(); FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject); void GenerateContent(); void TransformContent(CFX_Matrix& matrix); - protected: + private: void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj); void ProcessForm(CFX_ByteTextBuf& buf, const uint8_t* data, @@ -183,7 +183,6 @@ class CPDF_PageContentGenerate { CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, const FX_CHAR* szType); - private: CPDF_Page* m_pPage; CPDF_Document* m_pDocument; CFX_ArrayTemplate<CPDF_PageObject*> m_pageObjects; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp index f00cf5f8f5..f1565cd9a2 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp @@ -14,7 +14,7 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& ar, CFX_Matrix& matrix) { << matrix.e << " " << matrix.f; return ar; } -CPDF_PageContentGenerate::CPDF_PageContentGenerate(CPDF_Page* pPage) +CPDF_PageContentGenerator::CPDF_PageContentGenerator(CPDF_Page* pPage) : m_pPage(pPage) { m_pDocument = NULL; if (m_pPage) { @@ -25,15 +25,15 @@ CPDF_PageContentGenerate::CPDF_PageContentGenerate(CPDF_Page* pPage) InsertPageObject(pPage->GetNextObject(pos)); } } -CPDF_PageContentGenerate::~CPDF_PageContentGenerate() {} -FX_BOOL CPDF_PageContentGenerate::InsertPageObject( +CPDF_PageContentGenerator::~CPDF_PageContentGenerator() {} +FX_BOOL CPDF_PageContentGenerator::InsertPageObject( CPDF_PageObject* pPageObject) { if (!pPageObject) { return FALSE; } return m_pageObjects.Add(pPageObject); } -void CPDF_PageContentGenerate::GenerateContent() { +void CPDF_PageContentGenerator::GenerateContent() { CFX_ByteTextBuf buf; CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict; for (int i = 0; i < m_pageObjects.GetSize(); ++i) { @@ -53,7 +53,7 @@ void CPDF_PageContentGenerate::GenerateContent() { m_pDocument->AddIndirectObject(pStream); pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum()); } -CFX_ByteString CPDF_PageContentGenerate::RealizeResource( +CFX_ByteString CPDF_PageContentGenerator::RealizeResource( CPDF_Object* pResourceObj, const FX_CHAR* szType) { if (!m_pPage->m_pResources) { @@ -79,8 +79,8 @@ CFX_ByteString CPDF_PageContentGenerate::RealizeResource( pResList->AddReference(name, m_pDocument, pResourceObj->GetObjNum()); return name; } -void CPDF_PageContentGenerate::ProcessImage(CFX_ByteTextBuf& buf, - CPDF_ImageObject* pImageObj) { +void CPDF_PageContentGenerator::ProcessImage(CFX_ByteTextBuf& buf, + CPDF_ImageObject* pImageObj) { if ((pImageObj->m_Matrix.a == 0 && pImageObj->m_Matrix.b == 0) || (pImageObj->m_Matrix.c == 0 && pImageObj->m_Matrix.d == 0)) { return; @@ -98,10 +98,10 @@ void CPDF_PageContentGenerate::ProcessImage(CFX_ByteTextBuf& buf, buf << "/" << PDF_NameEncode(name) << " Do Q\n"; } } -void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, - const uint8_t* data, - FX_DWORD size, - CFX_Matrix& matrix) { +void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf, + const uint8_t* data, + FX_DWORD size, + CFX_Matrix& matrix) { if (!data || !size) { return; } @@ -117,7 +117,7 @@ void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, CFX_ByteString name = RealizeResource(pStream, "XObject"); buf << "/" << PDF_NameEncode(name) << " Do Q\n"; } -void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix) { +void CPDF_PageContentGenerator::TransformContent(CFX_Matrix& matrix) { CPDF_Dictionary* pDict = m_pPage->m_pFormDict; CPDF_Object* pContent = pDict ? pDict->GetElementValue("Contents") : NULL; if (!pContent) |