diff options
author | Nicolas Pena <npm@chromium.org> | 2017-02-14 11:15:58 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-14 16:40:40 +0000 |
commit | 22da8c268d2228203b40a8c73a2d3f6c25fc9acc (patch) | |
tree | 65b402021e52efb64578a312e67627f4eba8f5c9 /fpdfsdk/fxedit/fxet_edit.cpp | |
parent | dd40b8b802da1c068dab450b68c934be0358b6de (diff) | |
download | pdfium-22da8c268d2228203b40a8c73a2d3f6c25fc9acc.tar.xz |
Delete unused method CPWL_Edit::GeneratePageObjects
Change-Id: I114afbee411784118e81b4528ae740528c4aef2c
Reviewed-on: https://pdfium-review.googlesource.com/2693
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fxedit/fxet_edit.cpp')
-rw-r--r-- | fpdfsdk/fxedit/fxet_edit.cpp | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index 1942232553..f71876f26b 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -119,44 +119,6 @@ void DrawTextString(CFX_RenderDevice* pDevice, } } -CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjectHolder* pObjectHolder, - FX_COLORREF crText, - CPDF_Font* pFont, - FX_FLOAT fFontSize, - FX_FLOAT fCharSpace, - int32_t nHorzScale, - const CFX_FloatPoint& point, - const CFX_ByteString& text) { - std::unique_ptr<CPDF_TextObject> pTxtObj(new CPDF_TextObject); - pTxtObj->m_TextState.SetFont(pFont); - pTxtObj->m_TextState.SetFontSize(fFontSize); - pTxtObj->m_TextState.SetCharSpace(fCharSpace); - pTxtObj->m_TextState.SetWordSpace(0); - pTxtObj->m_TextState.SetTextMode(TextRenderingMode::MODE_FILL); - - FX_FLOAT* matrix = pTxtObj->m_TextState.GetMutableMatrix(); - matrix[0] = nHorzScale / 100.0f; - matrix[1] = 0; - matrix[2] = 0; - matrix[3] = 1; - - FX_FLOAT rgb[3]; - rgb[0] = FXARGB_R(crText) / 255.0f; - rgb[1] = FXARGB_G(crText) / 255.0f; - rgb[2] = FXARGB_B(crText) / 255.0f; - pTxtObj->m_ColorState.SetFillColor( - CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); - pTxtObj->m_ColorState.SetStrokeColor( - CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); - - pTxtObj->SetPosition(point.x, point.y); - pTxtObj->SetText(text); - - CPDF_TextObject* pRet = pTxtObj.get(); - pObjectHolder->GetPageObjectList()->push_back(std::move(pTxtObj)); - return pRet; -} - } // namespace CFX_Edit_Iterator::CFX_Edit_Iterator(CFX_Edit* pEdit, @@ -904,64 +866,6 @@ void CFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, pDevice->RestoreState(false); } -// static -void CFX_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - CFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, - const CPVT_WordRange* pRange, - FX_COLORREF crText, - std::vector<CPDF_TextObject*>* ObjArray) { - ObjArray->clear(); - - IPVT_FontMap* pFontMap = pEdit->GetFontMap(); - if (!pFontMap) - return; - - FX_FLOAT fFontSize = pEdit->GetFontSize(); - int32_t nOldFontIndex = -1; - CFX_ByteTextBuf sTextBuf; - CPVT_WordPlace oldplace; - CFX_FloatPoint ptBT(0.0f, 0.0f); - CFX_Edit_Iterator* pIterator = pEdit->GetIterator(); - if (pRange) - pIterator->SetAt(pRange->BeginPos); - else - pIterator->SetAt(0); - - while (pIterator->NextWord()) { - CPVT_WordPlace place = pIterator->GetAt(); - if (pRange && place.WordCmp(pRange->EndPos) > 0) - break; - - CPVT_Word word; - if (!pIterator->GetWord(word)) - continue; - - if (place.LineCmp(oldplace) != 0 || nOldFontIndex != word.nFontIndex) { - if (sTextBuf.GetLength() > 0) { - ObjArray->push_back(AddTextObjToPageObjects( - pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), - fFontSize, 0.0f, 100, - CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.MakeString())); - - sTextBuf.Clear(); - } - ptBT = word.ptWord; - nOldFontIndex = word.nFontIndex; - } - sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, 0) - .AsStringC(); - oldplace = place; - } - if (sTextBuf.GetLength() > 0) { - ObjArray->push_back(AddTextObjToPageObjects( - pObjectHolder, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, - 0.0f, 100, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), - sTextBuf.MakeString())); - } -} - CFX_Edit::CFX_Edit() : m_pVT(new CPDF_VariableText), m_pNotify(nullptr), |