summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtparag.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-06-10 13:19:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-10 13:19:16 -0700
commitc14c958db677802a52e84a0e772f6185eb89b3fd (patch)
tree8ae7568163fc0478e678f9e0721f73e29c959bc2 /xfa/fde/cfde_txtedtparag.cpp
parentcfb77ccb1c057d6beb73f0043e42eee8c4822f84 (diff)
downloadpdfium-c14c958db677802a52e84a0e772f6185eb89b3fd.tar.xz
Remove redundant casts, part 9.
Make CFDE_TxtEdtParag::m_lpData a int32_t*, not void*, since it is cast to int32_t everywhere it is used. Many fxbarcode casts are redundant, likely the result of previous generic PtrArray replacement with templated type. Review-Url: https://codereview.chromium.org/2059953002
Diffstat (limited to 'xfa/fde/cfde_txtedtparag.cpp')
-rw-r--r--xfa/fde/cfde_txtedtparag.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fde/cfde_txtedtparag.cpp b/xfa/fde/cfde_txtedtparag.cpp
index 11015f59fd..9ba0fa5431 100644
--- a/xfa/fde/cfde_txtedtparag.cpp
+++ b/xfa/fde/cfde_txtedtparag.cpp
@@ -29,7 +29,7 @@ CFDE_TxtEdtParag::~CFDE_TxtEdtParag() {
void CFDE_TxtEdtParag::LoadParag() {
if (m_lpData) {
- ((int32_t*)m_lpData)[0]++;
+ m_lpData[0]++;
return;
}
CFX_TxtBreak* pTxtBreak = m_pEngine->GetTextBreak();
@@ -77,12 +77,12 @@ void CFDE_TxtEdtParag::LoadParag() {
pTxtBreak->ClearBreakPieces();
int32_t nLineCount = LineBaseArr.GetSize();
m_nLineCount = nLineCount;
- if (m_lpData)
- m_lpData = FX_Realloc(int32_t, m_lpData, (nLineCount + 1));
- else
+ if (m_lpData) {
+ m_lpData = FX_Realloc(int32_t, m_lpData, nLineCount + 1);
+ } else {
m_lpData = FX_Alloc(int32_t, nLineCount + 1);
-
- int32_t* pIntArr = (int32_t*)m_lpData;
+ }
+ int32_t* pIntArr = m_lpData;
pIntArr[0] = 1;
m_nLineCount = nLineCount;
pIntArr++;
@@ -93,9 +93,9 @@ void CFDE_TxtEdtParag::LoadParag() {
}
void CFDE_TxtEdtParag::UnloadParag() {
- ((int32_t*)m_lpData)[0]--;
- ASSERT(((int32_t*)m_lpData)[0] >= 0);
- if (((int32_t*)m_lpData)[0] == 0) {
+ m_lpData[0]--;
+ ASSERT(m_lpData[0] >= 0);
+ if (m_lpData[0] == 0) {
FX_Free(m_lpData);
m_lpData = nullptr;
}
@@ -140,7 +140,7 @@ void CFDE_TxtEdtParag::CalcLines() {
void CFDE_TxtEdtParag::GetLineRange(int32_t nLineIndex,
int32_t& nStart,
int32_t& nCount) const {
- int32_t* pLineBaseArr = (int32_t*)m_lpData;
+ int32_t* pLineBaseArr = m_lpData;
ASSERT(nLineIndex < m_nLineCount);
nStart = m_nCharStart;
pLineBaseArr++;