diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-01-21 10:49:56 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-01-21 10:49:56 -0800 |
commit | e19e06e430f76f1cdb126e772602c9fbc4dd1e8f (patch) | |
tree | d3d7fe1ceeed341e64f538325975e46e1fc93e0d /core | |
parent | 6c7508bf13e39e21f39d98fc1a6a6ad8aefb96c1 (diff) | |
download | pdfium-e19e06e430f76f1cdb126e772602c9fbc4dd1e8f.tar.xz |
Merge to XFA: Rename CPDF_PageContentGenerate to CPDF_PageContentGenerator.
Original Review URL: https://codereview.chromium.org/1611193003 .
(cherry picked from commit ca6d98f4dfe7d4fc506b72c91f122f471a53c878)
R=ochang@chromium.org
TBR=ochang@chromium.org
Review URL: https://codereview.chromium.org/1613163003 .
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) |