From 22da8c268d2228203b40a8c73a2d3f6c25fc9acc Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Tue, 14 Feb 2017 11:15:58 -0500 Subject: Delete unused method CPWL_Edit::GeneratePageObjects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I114afbee411784118e81b4528ae740528c4aef2c Reviewed-on: https://pdfium-review.googlesource.com/2693 Commit-Queue: Nicolás Peña Reviewed-by: dsinclair --- fpdfsdk/fxedit/fxet_edit.cpp | 96 -------------------------------------------- 1 file changed, 96 deletions(-) (limited to 'fpdfsdk/fxedit/fxet_edit.cpp') 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 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* 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), -- cgit v1.2.3