diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-16 17:15:32 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-16 17:15:32 -0800 |
commit | 32c70815316672091946be88e5941089c359d151 (patch) | |
tree | 5c09a48725bb43b07d09a435f38ead6a933e1712 /fpdfsdk/src/fxedit/fxet_pageobjs.cpp | |
parent | 4e44b4049bd4790bcb6c835455632c81c34e78b6 (diff) | |
download | pdfium-32c70815316672091946be88e5941089c359d151.tar.xz |
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 .
Diffstat (limited to 'fpdfsdk/src/fxedit/fxet_pageobjs.cpp')
-rw-r--r-- | fpdfsdk/src/fxedit/fxet_pageobjs.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
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, |