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

Unified Diff: core/fpdfapi/font/cpdf_cidfont.cpp

Issue 2611413002: Remove CFX_ArrayTemplate from fpdfapi (Closed)
Patch Set: comment Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/font/cpdf_cidfont.h ('k') | core/fpdfapi/font/font_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/font/cpdf_cidfont.cpp
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index 91df025e0ff2732654e8d994c1ef3c6b20dd50b6..c6c6992562a356e5cfcd8a16807e59ee41fc2eef 100644
--- a/core/fpdfapi/font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/font/cpdf_cidfont.cpp
@@ -391,7 +391,7 @@ bool CPDF_CIDFont::Load() {
m_DefaultWidth = pCIDFontDict->GetIntegerFor("DW", 1000);
CPDF_Array* pWidthArray = pCIDFontDict->GetArrayFor("W");
if (pWidthArray)
- LoadMetricsArray(pWidthArray, m_WidthList, 1);
+ LoadMetricsArray(pWidthArray, &m_WidthList, 1);
if (!IsEmbedded())
LoadSubstFont();
@@ -416,7 +416,7 @@ bool CPDF_CIDFont::Load() {
if (IsVertWriting()) {
pWidthArray = pCIDFontDict->GetArrayFor("W2");
if (pWidthArray)
- LoadMetricsArray(pWidthArray, m_VertMetrics, 3);
+ LoadMetricsArray(pWidthArray, &m_VertMetrics, 3);
CPDF_Array* pDefaultArray = pCIDFontDict->GetArrayFor("DW2");
if (pDefaultArray) {
m_DefaultVY = pDefaultArray->GetIntegerAt(0);
@@ -505,9 +505,9 @@ int CPDF_CIDFont::GetCharWidthF(uint32_t charcode) {
return (charcode >= 32 && charcode < 127) ? 500 : 0;
uint16_t cid = CIDFromCharCode(charcode);
- int size = m_WidthList.GetSize();
- const uint32_t* pList = m_WidthList.GetData();
- for (int i = 0; i < size; i += 3) {
+ size_t size = m_WidthList.size();
+ const uint32_t* pList = m_WidthList.data();
+ for (size_t i = 0; i < size; i += 3) {
const uint32_t* pEntry = pList + i;
if (IsMetricForCID(pEntry, cid))
return static_cast<int>(pEntry[2]);
@@ -516,10 +516,10 @@ int CPDF_CIDFont::GetCharWidthF(uint32_t charcode) {
}
short CPDF_CIDFont::GetVertWidth(uint16_t CID) const {
- uint32_t vertsize = m_VertMetrics.GetSize() / 5;
+ size_t vertsize = m_VertMetrics.size() / 5;
if (vertsize) {
- const uint32_t* pTable = m_VertMetrics.GetData();
- for (uint32_t i = 0; i < vertsize; i++) {
+ const uint32_t* pTable = m_VertMetrics.data();
+ for (size_t i = 0; i < vertsize; i++) {
const uint32_t* pEntry = pTable + (i * 5);
if (IsMetricForCID(pEntry, CID))
return static_cast<short>(pEntry[2]);
@@ -529,10 +529,10 @@ short CPDF_CIDFont::GetVertWidth(uint16_t CID) const {
}
void CPDF_CIDFont::GetVertOrigin(uint16_t CID, short& vx, short& vy) const {
- uint32_t vertsize = m_VertMetrics.GetSize() / 5;
+ size_t vertsize = m_VertMetrics.size() / 5;
if (vertsize) {
- const uint32_t* pTable = m_VertMetrics.GetData();
- for (uint32_t i = 0; i < vertsize; i++) {
+ const uint32_t* pTable = m_VertMetrics.data();
+ for (size_t i = 0; i < vertsize; i++) {
const uint32_t* pEntry = pTable + (i * 5);
if (IsMetricForCID(pEntry, CID)) {
vx = static_cast<short>(pEntry[3]);
@@ -542,9 +542,9 @@ void CPDF_CIDFont::GetVertOrigin(uint16_t CID, short& vx, short& vy) const {
}
}
uint32_t dwWidth = m_DefaultWidth;
- int size = m_WidthList.GetSize();
- const uint32_t* pList = m_WidthList.GetData();
- for (int i = 0; i < size; i += 3) {
+ size_t size = m_WidthList.size();
+ const uint32_t* pList = m_WidthList.data();
+ for (size_t i = 0; i < size; i += 3) {
const uint32_t* pEntry = pList + i;
if (IsMetricForCID(pEntry, CID)) {
dwWidth = pEntry[2];
@@ -771,7 +771,7 @@ void CPDF_CIDFont::LoadSubstFont() {
}
void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
- CFX_ArrayTemplate<uint32_t>& result,
+ std::vector<uint32_t>* result,
int nElements) {
int width_status = 0;
int iCurElement = 0;
@@ -787,10 +787,10 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
return;
for (size_t j = 0; j < pObjArray->GetCount(); j += nElements) {
- result.Add(first_code);
- result.Add(first_code);
+ result->push_back(first_code);
+ result->push_back(first_code);
for (int k = 0; k < nElements; k++)
- result.Add(pObjArray->GetIntegerAt(j + k));
+ result->push_back(pObjArray->GetIntegerAt(j + k));
first_code++;
}
width_status = 0;
@@ -804,10 +804,10 @@ void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
iCurElement = 0;
} else {
if (!iCurElement) {
- result.Add(first_code);
- result.Add(last_code);
+ result->push_back(first_code);
+ result->push_back(last_code);
}
- result.Add(pObj->GetInteger());
+ result->push_back(pObj->GetInteger());
iCurElement++;
if (iCurElement == nElements)
width_status = 0;
« no previous file with comments | « core/fpdfapi/font/cpdf_cidfont.h ('k') | core/fpdfapi/font/font_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698