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_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 fs = m_DefFontSize; | 1136 fs = m_DefFontSize; |
1137 } | 1137 } |
1138 m_pCurStates->m_TextState.GetModify()->m_FontSize = fs; | 1138 m_pCurStates->m_TextState.GetModify()->m_FontSize = fs; |
1139 CPDF_Font* pFont = FindFont(GetString(1)); | 1139 CPDF_Font* pFont = FindFont(GetString(1)); |
1140 if (pFont) { | 1140 if (pFont) { |
1141 m_pCurStates->m_TextState.SetFont(pFont); | 1141 m_pCurStates->m_TextState.SetFont(pFont); |
1142 } | 1142 } |
1143 } | 1143 } |
1144 | 1144 |
1145 CPDF_Object* CPDF_StreamContentParser::FindResourceObj( | 1145 CPDF_Object* CPDF_StreamContentParser::FindResourceObj( |
1146 const CFX_ByteStringC& type, | 1146 const CFX_ByteString& type, |
1147 const CFX_ByteString& name) { | 1147 const CFX_ByteString& name) { |
1148 if (!m_pResources) { | 1148 if (!m_pResources) { |
1149 return NULL; | 1149 return NULL; |
1150 } | 1150 } |
1151 if (m_pResources == m_pPageResources) { | 1151 if (m_pResources == m_pPageResources) { |
1152 CPDF_Dictionary* pList = m_pResources->GetDictBy(type); | 1152 CPDF_Dictionary* pList = m_pResources->GetDictBy(type); |
1153 if (!pList) { | 1153 if (!pList) { |
1154 return NULL; | 1154 return NULL; |
1155 } | 1155 } |
1156 CPDF_Object* pRes = pList->GetDirectObjectBy(name); | 1156 CPDF_Object* pRes = pList->GetDirectObjectBy(name); |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 op.key = key; | 1676 op.key = key; |
1677 op.replacement = fullname; | 1677 op.replacement = fullname; |
1678 replacements.push_back(op); | 1678 replacements.push_back(op); |
1679 } | 1679 } |
1680 } else { | 1680 } else { |
1681 PDF_ReplaceAbbr(value); | 1681 PDF_ReplaceAbbr(value); |
1682 } | 1682 } |
1683 } | 1683 } |
1684 for (const auto& op : replacements) { | 1684 for (const auto& op : replacements) { |
1685 if (op.is_replace_key) | 1685 if (op.is_replace_key) |
1686 pDict->ReplaceKey(op.key, op.replacement); | 1686 pDict->ReplaceKey(op.key, CFX_ByteString(op.replacement)); |
1687 else | 1687 else |
1688 pDict->SetAtName(op.key, op.replacement); | 1688 pDict->SetAtName(op.key, CFX_ByteString(op.replacement)); |
1689 } | 1689 } |
1690 break; | 1690 break; |
1691 } | 1691 } |
1692 case CPDF_Object::ARRAY: { | 1692 case CPDF_Object::ARRAY: { |
1693 CPDF_Array* pArray = pObj->AsArray(); | 1693 CPDF_Array* pArray = pObj->AsArray(); |
1694 for (size_t i = 0; i < pArray->GetCount(); i++) { | 1694 for (size_t i = 0; i < pArray->GetCount(); i++) { |
1695 CPDF_Object* pElement = pArray->GetObjectAt(i); | 1695 CPDF_Object* pElement = pArray->GetObjectAt(i); |
1696 if (pElement->IsName()) { | 1696 if (pElement->IsName()) { |
1697 CFX_ByteString name = pElement->GetString(); | 1697 CFX_ByteString name = pElement->GetString(); |
1698 CFX_ByteStringC fullname = PDF_FindFullName( | 1698 CFX_ByteStringC fullname = PDF_FindFullName( |
1699 PDF_InlineValueAbbr, FX_ArraySize(PDF_InlineValueAbbr), | 1699 PDF_InlineValueAbbr, FX_ArraySize(PDF_InlineValueAbbr), |
1700 name.AsStringC()); | 1700 name.AsStringC()); |
1701 if (!fullname.IsEmpty()) { | 1701 if (!fullname.IsEmpty()) { |
1702 pArray->SetAt(i, new CPDF_Name(fullname)); | 1702 pArray->SetAt(i, new CPDF_Name(CFX_ByteString(fullname))); |
1703 } | 1703 } |
1704 } else { | 1704 } else { |
1705 PDF_ReplaceAbbr(pElement); | 1705 PDF_ReplaceAbbr(pElement); |
1706 } | 1706 } |
1707 } | 1707 } |
1708 break; | 1708 break; |
1709 } | 1709 } |
1710 default: | 1710 default: |
1711 break; | 1711 break; |
1712 } | 1712 } |
1713 } | 1713 } |
OLD | NEW |