summaryrefslogtreecommitdiff
path: root/core/fpdfapi/font/cpdf_cidfont.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2017-01-09 07:01:36 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-09 07:01:36 -0800
commit0fa471794a88b262f9114b973d74b1c33e4e592b (patch)
tree0922c56f6e8ba029cd59dc85c8e2c05689cc334a /core/fpdfapi/font/cpdf_cidfont.cpp
parent5037839bb0b91792b81a3e455dead1314fcc7a6d (diff)
downloadpdfium-0fa471794a88b262f9114b973d74b1c33e4e592b.tar.xz
Remove CFX_ArrayTemplate from fpdfapi
Review-Url: https://codereview.chromium.org/2611413002
Diffstat (limited to 'core/fpdfapi/font/cpdf_cidfont.cpp')
-rw-r--r--core/fpdfapi/font/cpdf_cidfont.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/core/fpdfapi/font/cpdf_cidfont.cpp b/core/fpdfapi/font/cpdf_cidfont.cpp
index 91df025e0f..c6c6992562 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;