summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-20 16:50:26 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-21 17:43:09 +0000
commit9c045de6cf02f7dbd0634af566396ba9352b2830 (patch)
treef6a8f1491ab1198e20fe2409a307278f94f9a344
parent5c529e6318d46121a5ea38d3edb42c8d9f580fe8 (diff)
downloadpdfium-9c045de6cf02f7dbd0634af566396ba9352b2830.tar.xz
Use std::vector for m_HotKeys
Change-Id: I637fe236ae351bf6fcf8aa2913b94f55d997c612 Reviewed-on: https://pdfium-review.googlesource.com/3132 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r--xfa/fde/tto/fde_textout.cpp11
-rw-r--r--xfa/fde/tto/fde_textout.h2
2 files changed, 5 insertions, 8 deletions
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index 6d56ec70c8..7f6eddd9ce 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -409,7 +409,7 @@ void CFDE_TextOut::LoadText(const wchar_t* pwsStr,
float fLineStep = (m_fLineSpace > m_fFontSize) ? m_fLineSpace : m_fFontSize;
float fLineStop = rect.bottom();
m_fLinePos = rect.top;
- m_hotKeys.RemoveAll();
+ m_HotKeys.clear();
int32_t iStartChar = 0;
int32_t iChars = 0;
int32_t iPieceWidths = 0;
@@ -420,7 +420,7 @@ void CFDE_TextOut::LoadText(const wchar_t* pwsStr,
wch = *pwsStr++;
if (bHotKey && wch == L'&' && *(pStr - 1) != L'&') {
if (iTxtLength > 0)
- m_hotKeys.Add(iChars);
+ m_HotKeys.push_back(iChars);
continue;
}
*pStr++ = wch;
@@ -730,11 +730,8 @@ void CFDE_TextOut::DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen* pPen) {
iLineCount++;
}
if (bHotKey) {
- int32_t iHotKeys = m_hotKeys.GetSize();
- int32_t iCount = GetCharRects(pPiece);
- if (iCount > 0) {
- for (int32_t i = 0; i < iHotKeys; i++) {
- int32_t iCharIndex = m_hotKeys.GetAt(i);
+ if (GetCharRects(pPiece) > 0) {
+ for (int32_t iCharIndex : m_HotKeys) {
if (iCharIndex >= pPiece->iStartChar &&
iCharIndex < pPiece->iStartChar + pPiece->iChars) {
CFX_RectF rect = m_rectArray[iCharIndex - pPiece->iStartChar];
diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h
index bbc796d7ac..6883a5701f 100644
--- a/xfa/fde/tto/fde_textout.h
+++ b/xfa/fde/tto/fde_textout.h
@@ -168,7 +168,7 @@ class CFDE_TextOut {
int32_t m_iTotalLines;
std::vector<FXTEXT_CHARPOS> m_CharPos;
std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice;
- CFX_ArrayTemplate<int32_t> m_hotKeys;
+ std::vector<int32_t> m_HotKeys;
std::vector<CFX_RectF> m_rectArray;
};