OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fpdfdoc/cpvt_generateap.h" | 7 #include "core/fpdfdoc/cpvt_generateap.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" | 9 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 return GenerateWidgetAP(pDoc, pAnnotDict, 2); | 497 return GenerateWidgetAP(pDoc, pAnnotDict, 2); |
498 } | 498 } |
499 | 499 |
500 // Static. | 500 // Static. |
501 CFX_ByteString CPVT_GenerateAP::GenerateEditAP( | 501 CFX_ByteString CPVT_GenerateAP::GenerateEditAP( |
502 IPVT_FontMap* pFontMap, | 502 IPVT_FontMap* pFontMap, |
503 CPDF_VariableText::Iterator* pIterator, | 503 CPDF_VariableText::Iterator* pIterator, |
504 const CFX_FloatPoint& ptOffset, | 504 const CFX_FloatPoint& ptOffset, |
505 FX_BOOL bContinuous, | 505 FX_BOOL bContinuous, |
506 uint16_t SubWord) { | 506 uint16_t SubWord) { |
507 CFX_ByteTextBuf sEditStream, sLineStream, sWords; | 507 CFX_ByteTextBuf sEditStream; |
508 CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); | 508 CFX_ByteTextBuf sLineStream; |
| 509 CFX_ByteTextBuf sWords; |
| 510 CFX_FloatPoint ptOld(0.0f, 0.0f); |
| 511 CFX_FloatPoint ptNew(0.0f, 0.0f); |
509 int32_t nCurFontIndex = -1; | 512 int32_t nCurFontIndex = -1; |
| 513 |
510 pIterator->SetAt(0); | 514 pIterator->SetAt(0); |
511 | 515 |
512 CPVT_WordPlace oldplace; | 516 CPVT_WordPlace oldplace; |
513 while (pIterator->NextWord()) { | 517 while (pIterator->NextWord()) { |
514 CPVT_WordPlace place = pIterator->GetAt(); | 518 CPVT_WordPlace place = pIterator->GetAt(); |
515 if (bContinuous) { | 519 if (bContinuous) { |
516 if (place.LineCmp(oldplace) != 0) { | 520 if (place.LineCmp(oldplace) != 0) { |
517 if (sWords.GetSize() > 0) { | 521 if (sWords.GetSize() > 0) { |
518 sLineStream << GetWordRenderString(sWords.AsStringC()); | 522 sLineStream << GetWordRenderString(sWords.AsStringC()); |
519 sEditStream << sLineStream; | 523 sEditStream << sLineStream; |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 int32_t nFontIndex, | 755 int32_t nFontIndex, |
752 FX_FLOAT fFontSize) { | 756 FX_FLOAT fFontSize) { |
753 CFX_ByteTextBuf sRet; | 757 CFX_ByteTextBuf sRet; |
754 if (pFontMap) { | 758 if (pFontMap) { |
755 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); | 759 CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); |
756 if (sFontAlias.GetLength() > 0 && fFontSize > 0) | 760 if (sFontAlias.GetLength() > 0 && fFontSize > 0) |
757 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; | 761 sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; |
758 } | 762 } |
759 return sRet.AsStringC(); | 763 return sRet.AsStringC(); |
760 } | 764 } |
OLD | NEW |