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 ------------------------------------------ fpdfsdk/fxedit/fxet_edit.h | 6 --- fpdfsdk/pdfwindow/PWL_Edit.cpp | 18 -------- fpdfsdk/pdfwindow/PWL_Edit.h | 6 --- 4 files changed, 126 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 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), diff --git a/fpdfsdk/fxedit/fxet_edit.h b/fpdfsdk/fxedit/fxet_edit.h index 555c58b0a3..9c3e826ecb 100644 --- a/fpdfsdk/fxedit/fxet_edit.h +++ b/fpdfsdk/fxedit/fxet_edit.h @@ -331,12 +331,6 @@ class CFX_Edit { const CPVT_WordRange* pRange, CFX_SystemHandler* pSystemHandler, CFFL_FormFiller* pFFLData); - static void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - CFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, - const CPVT_WordRange* pRange, - FX_COLORREF crText, - std::vector* ObjArray); CFX_Edit(); ~CFX_Edit(); diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp index b9958a3128..bca9397047 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp @@ -874,21 +874,3 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace& place, range.Set(wpStart, wpEnd); return range; } - -void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset, - std::vector* ObjArray) { - CFX_Edit::GeneratePageObjects( - pObjectHolder, m_pEdit.get(), ptOffset, nullptr, - CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), - ObjArray); -} - -void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset) { - std::vector ObjArray; - CFX_Edit::GeneratePageObjects( - pObjectHolder, m_pEdit.get(), ptOffset, nullptr, - CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), - &ObjArray); -} diff --git a/fpdfsdk/pdfwindow/PWL_Edit.h b/fpdfsdk/pdfwindow/PWL_Edit.h index 801dedd0ac..e125ef78b0 100644 --- a/fpdfsdk/pdfwindow/PWL_Edit.h +++ b/fpdfsdk/pdfwindow/PWL_Edit.h @@ -105,12 +105,6 @@ class CPWL_Edit : public CPWL_EditCtrl { m_pFillerNotify = pNotify; } - void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset, - std::vector* ObjArray); - void GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, - const CFX_FloatPoint& ptOffset); - bool IsProceedtoOnChar(uint16_t nKeyCode, uint32_t nFlag); void AttachFFLData(CFFL_FormFiller* pData) { m_pFormFiller = pData; } -- cgit v1.2.3