From bbf27133e72cdd824188acd309dfc2517cfcf026 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 10 Jun 2016 13:26:33 -0700 Subject: Remove redundant make_pair* cast in fxbarcode Review-Url: https://codereview.chromium.org/2052413002 --- xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp index 812b7926ac..9935326cc1 100644 --- a/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp +++ b/xfa/fxbarcode/qrcode/BC_QRCoderEncoder.cpp @@ -95,20 +95,19 @@ void CBC_QRCoderEncoder::AppendDataModeLenghInfo( CFX_ByteString& encoding, int32_t& e) { for (int32_t i = 0; i < splitResult.GetSize(); i++) { - tempMode = ((Make_Pair*)splitResult[i])->m_mode; + tempMode = splitResult[i]->m_mode; if (tempMode == CBC_QRCoderMode::sGBK) { AppendModeInfo(tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - AppendLengthInfo(((Make_Pair*)splitResult[i])->m_string.GetLength(), + AppendLengthInfo(splitResult[i]->m_string.GetLength(), qrCode->GetVersion(), tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - AppendBytes(((Make_Pair*)splitResult[i])->m_string, tempMode, - &headerAndDataBits, encoding, e); + AppendBytes(splitResult[i]->m_string, tempMode, &headerAndDataBits, + encoding, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } else if (tempMode == CBC_QRCoderMode::sBYTE) { CFX_ByteArray bytes; - CBC_UtilCodingConvert::LocaleToUtf8( - ((Make_Pair*)splitResult[i])->m_string, bytes); + CBC_UtilCodingConvert::LocaleToUtf8(splitResult[i]->m_string, bytes); AppendModeInfo(tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); AppendLengthInfo(bytes.GetSize(), qrCode->GetVersion(), tempMode, @@ -119,20 +118,20 @@ void CBC_QRCoderEncoder::AppendDataModeLenghInfo( } else if (tempMode == CBC_QRCoderMode::sALPHANUMERIC) { AppendModeInfo(tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - AppendLengthInfo(((Make_Pair*)splitResult[i])->m_string.GetLength(), + AppendLengthInfo(splitResult[i]->m_string.GetLength(), qrCode->GetVersion(), tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - AppendBytes(((Make_Pair*)splitResult[i])->m_string, tempMode, - &headerAndDataBits, encoding, e); + AppendBytes(splitResult[i]->m_string, tempMode, &headerAndDataBits, + encoding, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } else if (tempMode == CBC_QRCoderMode::sNUMERIC) { AppendModeInfo(tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - AppendLengthInfo(((Make_Pair*)splitResult[i])->m_string.GetLength(), + AppendLengthInfo(splitResult[i]->m_string.GetLength(), qrCode->GetVersion(), tempMode, &headerAndDataBits, e); BC_EXCEPTION_CHECK_ReturnVoid(e); - AppendBytes(((Make_Pair*)splitResult[i])->m_string, tempMode, - &headerAndDataBits, encoding, e); + AppendBytes(splitResult[i]->m_string, tempMode, &headerAndDataBits, + encoding, e); BC_EXCEPTION_CHECK_ReturnVoid(e); } else { e = BCExceptionUnknown; -- cgit v1.2.3