Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Side by Side Diff: core/fpdfapi/fpdf_page/cpdf_allstates.cpp

Issue 1867183002: Use std::vector as internal storage for CPDF_Array (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/fpdfapi/fpdf_page/cpdf_allstates.h" 7 #include "core/fpdfapi/fpdf_page/cpdf_allstates.h"
8 8
9 #include "core/fpdfapi/fpdf_page/pageint.h" 9 #include "core/fpdfapi/fpdf_page/pageint.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
(...skipping 28 matching lines...) Expand all
39 m_TextLeading = src.m_TextLeading; 39 m_TextLeading = src.m_TextLeading;
40 m_TextRise = src.m_TextRise; 40 m_TextRise = src.m_TextRise;
41 m_TextHorzScale = src.m_TextHorzScale; 41 m_TextHorzScale = src.m_TextHorzScale;
42 } 42 }
43 43
44 void CPDF_AllStates::SetLineDash(CPDF_Array* pArray, 44 void CPDF_AllStates::SetLineDash(CPDF_Array* pArray,
45 FX_FLOAT phase, 45 FX_FLOAT phase,
46 FX_FLOAT scale) { 46 FX_FLOAT scale) {
47 CFX_GraphStateData* pData = m_GraphState.GetModify(); 47 CFX_GraphStateData* pData = m_GraphState.GetModify();
48 pData->m_DashPhase = phase * scale; 48 pData->m_DashPhase = phase * scale;
49 pData->SetDashCount(pArray->GetCount()); 49 pData->SetDashCount(static_cast<int>(pArray->GetCount()));
50 for (uint32_t i = 0; i < pArray->GetCount(); i++) { 50 for (size_t i = 0; i < pArray->GetCount(); i++)
51 pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale; 51 pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale;
52 }
53 } 52 }
54 53
55 void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, 54 void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
56 CPDF_StreamContentParser* pParser) { 55 CPDF_StreamContentParser* pParser) {
57 CPDF_GeneralStateData* pGeneralState = m_GeneralState.GetModify(); 56 CPDF_GeneralStateData* pGeneralState = m_GeneralState.GetModify();
58 for (const auto& it : *pGS) { 57 for (const auto& it : *pGS) {
59 const CFX_ByteString& key_str = it.first; 58 const CFX_ByteString& key_str = it.first;
60 CPDF_Object* pElement = it.second; 59 CPDF_Object* pElement = it.second;
61 CPDF_Object* pObject = pElement ? pElement->GetDirect() : nullptr; 60 CPDF_Object* pObject = pElement ? pElement->GetDirect() : nullptr;
62 if (!pObject) 61 if (!pObject)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 case FXBSTR_ID('A', 'I', 'S', 0): 176 case FXBSTR_ID('A', 'I', 'S', 0):
178 pGeneralState->m_AlphaSource = pObject->GetInteger(); 177 pGeneralState->m_AlphaSource = pObject->GetInteger();
179 break; 178 break;
180 case FXBSTR_ID('T', 'K', 0, 0): 179 case FXBSTR_ID('T', 'K', 0, 0):
181 pGeneralState->m_TextKnockout = pObject->GetInteger(); 180 pGeneralState->m_TextKnockout = pObject->GetInteger();
182 break; 181 break;
183 } 182 }
184 } 183 }
185 pGeneralState->m_Matrix = m_CTM; 184 pGeneralState->m_Matrix = m_CTM;
186 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698