From 32c70815316672091946be88e5941089c359d151 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 16 Feb 2016 17:15:32 -0800 Subject: Split CPDF_PageObjectHolder off from CPDF_PageObjectList Eventually, we're going to expose an iterator over CPDF_PageObjectList that we don't want to be inherited by the CPDF_PageObjectHolder sub-classes: page and form. Also, the operations that the object holder performs dealing with inquiring about masks and such seem beyond the scope of what a list would provide. Hence the "Holder" name. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1701073002 . --- fpdfsdk/src/fxedit/fxet_pageobjs.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'fpdfsdk/src/fxedit') diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp index 6cdcc84991..d54e4649db 100644 --- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp @@ -409,7 +409,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, pDevice->RestoreState(); } -static void AddRectToPageObjects(CPDF_PageObjectList* pPageObjs, +static void AddRectToPageObjects(CPDF_PageObjectHolder* pPageObjs, FX_COLORREF crFill, const CPDF_Rect& rcFill) { CPDF_PathObject* pPathObj = new CPDF_PathObject; @@ -425,18 +425,19 @@ static void AddRectToPageObjects(CPDF_PageObjectList* pPageObjs, pPathObj->m_FillType = FXFILL_ALTERNATE; pPathObj->m_bStroke = FALSE; - - pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(), pPathObj); + pPageObjs->GetPageObjectList()->InsertObject( + pPageObjs->GetPageObjectList()->GetTailPosition(), pPathObj); } -static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjectList* pPageObjs, - FX_COLORREF crText, - CPDF_Font* pFont, - FX_FLOAT fFontSize, - FX_FLOAT fCharSpace, - int32_t nHorzScale, - const CPDF_Point& point, - const CFX_ByteString& text) { +static CPDF_TextObject* AddTextObjToPageObjects( + CPDF_PageObjectHolder* pPageObjs, + FX_COLORREF crText, + CPDF_Font* pFont, + FX_FLOAT fFontSize, + FX_FLOAT fCharSpace, + int32_t nHorzScale, + const CPDF_Point& point, + const CFX_ByteString& text) { CPDF_TextObject* pTxtObj = new CPDF_TextObject; CPDF_TextStateData* pTextStateData = pTxtObj->m_TextState.GetModify(); @@ -461,14 +462,14 @@ static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjectList* pPageObjs, pTxtObj->SetPosition(point.x, point.y); pTxtObj->SetText(text); - - pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(), pTxtObj); + pPageObjs->GetPageObjectList()->InsertObject( + pPageObjs->GetPageObjectList()->GetTailPosition(), pTxtObj); return pTxtObj; } void IFX_Edit::GeneratePageObjects( - CPDF_PageObjectList* pPageObjects, + CPDF_PageObjectHolder* pPageObjects, IFX_Edit* pEdit, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, @@ -532,7 +533,7 @@ void IFX_Edit::GeneratePageObjects( } void IFX_Edit::GenerateRichPageObjects( - CPDF_PageObjectList* pPageObjects, + CPDF_PageObjectHolder* pPageObjects, IFX_Edit* pEdit, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, @@ -624,7 +625,7 @@ void IFX_Edit::GenerateRichPageObjects( } } -void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjectList* pPageObjects, +void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjectHolder* pPageObjects, IFX_Edit* pEdit, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, -- cgit v1.2.3