| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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/fpdfapi/fpdf_font/include/cpdf_font.h" | 7 #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" |
| 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" | 8 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
| 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
| 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" | 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h" |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 int32_t nTop = FPDF_GetFieldAttr(pAnnotDict, "TI") | 609 int32_t nTop = FPDF_GetFieldAttr(pAnnotDict, "TI") |
| 610 ? FPDF_GetFieldAttr(pAnnotDict, "TI")->GetInteger() | 610 ? FPDF_GetFieldAttr(pAnnotDict, "TI")->GetInteger() |
| 611 : 0; | 611 : 0; |
| 612 CFX_ByteTextBuf sBody; | 612 CFX_ByteTextBuf sBody; |
| 613 if (pOpts) { | 613 if (pOpts) { |
| 614 FX_FLOAT fy = rcBody.top; | 614 FX_FLOAT fy = rcBody.top; |
| 615 for (int32_t i = nTop, sz = pOpts->GetCount(); i < sz; i++) { | 615 for (int32_t i = nTop, sz = pOpts->GetCount(); i < sz; i++) { |
| 616 if (IsFloatSmaller(fy, rcBody.bottom)) { | 616 if (IsFloatSmaller(fy, rcBody.bottom)) { |
| 617 break; | 617 break; |
| 618 } | 618 } |
| 619 if (CPDF_Object* pOpt = pOpts->GetElementValue(i)) { | 619 if (CPDF_Object* pOpt = pOpts->GetDirectObjectAt(i)) { |
| 620 CFX_WideString swItem; | 620 CFX_WideString swItem; |
| 621 if (pOpt->IsString()) | 621 if (pOpt->IsString()) |
| 622 swItem = pOpt->GetUnicodeText(); | 622 swItem = pOpt->GetUnicodeText(); |
| 623 else if (CPDF_Array* pArray = pOpt->AsArray()) | 623 else if (CPDF_Array* pArray = pOpt->AsArray()) |
| 624 swItem = pArray->GetElementValue(1)->GetUnicodeText(); | 624 swItem = pArray->GetDirectObjectAt(1)->GetUnicodeText(); |
| 625 | 625 |
| 626 FX_BOOL bSelected = FALSE; | 626 FX_BOOL bSelected = FALSE; |
| 627 if (pSels) { | 627 if (pSels) { |
| 628 for (uint32_t s = 0, ssz = pSels->GetCount(); s < ssz; s++) { | 628 for (uint32_t s = 0, ssz = pSels->GetCount(); s < ssz; s++) { |
| 629 if (i == pSels->GetIntegerAt(s)) { | 629 if (i == pSels->GetIntegerAt(s)) { |
| 630 bSelected = TRUE; | 630 bSelected = TRUE; |
| 631 break; | 631 break; |
| 632 } | 632 } |
| 633 } | 633 } |
| 634 } | 634 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 case CPVT_Color::kCMYK: | 929 case CPVT_Color::kCMYK: |
| 930 sColorStream << color.fColor1 << " " << color.fColor2 << " " | 930 sColorStream << color.fColor1 << " " << color.fColor2 << " " |
| 931 << color.fColor3 << " " << color.fColor4 << " " | 931 << color.fColor3 << " " << color.fColor4 << " " |
| 932 << (bFillOrStroke ? "k" : "K") << "\n"; | 932 << (bFillOrStroke ? "k" : "K") << "\n"; |
| 933 break; | 933 break; |
| 934 case CPVT_Color::kTransparent: | 934 case CPVT_Color::kTransparent: |
| 935 break; | 935 break; |
| 936 } | 936 } |
| 937 return sColorStream.GetByteString(); | 937 return sColorStream.GetByteString(); |
| 938 } | 938 } |
| OLD | NEW |