From 2e6864282e65c55ff6809f5aaae011b31c3a361a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 24 Feb 2016 18:20:51 -0800 Subject: Get rid of CBC_AutoPtr and use std::unique_ptr instead. Also fix IWYU in various fxbarcode headers. R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1734823002 . --- xfa/src/fxbarcode/oned/BC_OneDReader.h | 3 +-- xfa/src/fxbarcode/oned/BC_OneDimReader.cpp | 8 +++++--- xfa/src/fxbarcode/oned/BC_OneDimReader.h | 6 ++++-- xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp | 7 ++++--- xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h | 5 ++++- 5 files changed, 18 insertions(+), 11 deletions(-) (limited to 'xfa/src/fxbarcode/oned') diff --git a/xfa/src/fxbarcode/oned/BC_OneDReader.h b/xfa/src/fxbarcode/oned/BC_OneDReader.h index 5a55d1f5e2..27a1a3d7ee 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDReader.h +++ b/xfa/src/fxbarcode/oned/BC_OneDReader.h @@ -7,9 +7,8 @@ #ifndef XFA_SRC_FXBARCODE_ONED_BC_ONEDREADER_H_ #define XFA_SRC_FXBARCODE_ONED_BC_ONEDREADER_H_ -#include "core/include/fxcrt/fx_basic.h" +#include "xfa/src/fxbarcode/BC_Reader.h" -class CBC_Reader; class CBC_BinaryBitmap; class CBC_CommonBitArray; diff --git a/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp b/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp index 74f0db4068..da1f47bfe8 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OneDimReader.cpp @@ -20,10 +20,13 @@ * limitations under the License. */ +#include "xfa/src/fxbarcode/oned/BC_OneDimReader.h" + +#include + #include "xfa/src/fxbarcode/BC_Reader.h" #include "xfa/src/fxbarcode/common/BC_CommonBitArray.h" #include "xfa/src/fxbarcode/oned/BC_OneDReader.h" -#include "xfa/src/fxbarcode/oned/BC_OneDimReader.h" #include "xfa/src/fxbarcode/utils.h" const int32_t CBC_OneDimReader::MAX_AVG_VARIANCE = (int32_t)(256 * 0.48f); @@ -73,9 +76,8 @@ CFX_ByteString CBC_OneDimReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, int32_t& e) { - CFX_Int32Array* StartPattern = FindStartGuardPattern(row, e); + std::unique_ptr result(FindStartGuardPattern(row, e)); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - CBC_AutoPtr result(StartPattern); CFX_ByteString temp = DecodeRow(rowNumber, row, result.get(), hints, e); BC_EXCEPTION_CHECK_ReturnValue(e, ""); return temp; diff --git a/xfa/src/fxbarcode/oned/BC_OneDimReader.h b/xfa/src/fxbarcode/oned/BC_OneDimReader.h index 0a3e3c3d5d..3374bec63a 100644 --- a/xfa/src/fxbarcode/oned/BC_OneDimReader.h +++ b/xfa/src/fxbarcode/oned/BC_OneDimReader.h @@ -7,9 +7,11 @@ #ifndef XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ #define XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ -class CBC_OneDReader; +#include "core/include/fxcrt/fx_basic.h" +#include "xfa/src/fxbarcode/oned/BC_OneDReader.h" + class CBC_CommonBitArray; -class CBC_OneDimReader; + class CBC_OneDimReader : public CBC_OneDReader { private: const static int32_t MAX_AVG_VARIANCE; diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp index d7caf68226..3cbad1eade 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.cpp @@ -20,13 +20,15 @@ * limitations under the License. */ +#include "xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h" + #include +#include #include "core/include/fxcrt/fx_basic.h" #include "xfa/src/fxbarcode/BC_Reader.h" #include "xfa/src/fxbarcode/common/BC_CommonBitArray.h" #include "xfa/src/fxbarcode/oned/BC_OneDReader.h" -#include "xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h" #include "xfa/src/fxbarcode/oned/BC_OnedCode39Reader.h" #include "xfa/src/fxbarcode/utils.h" @@ -46,9 +48,8 @@ CFX_ByteString CBC_OnedCodaBarReader::DecodeRow(int32_t rowNumber, CBC_CommonBitArray* row, int32_t hints, int32_t& e) { - CFX_Int32Array* int32Ptr = FindAsteriskPattern(row, e); + std::unique_ptr start(FindAsteriskPattern(row, e)); BC_EXCEPTION_CHECK_ReturnValue(e, ""); - CBC_AutoPtr start(int32Ptr); (*start)[1] = 0; int32_t nextStart = (*start)[1]; int32_t end = row->GetSize(); diff --git a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h index e1cf9d8698..cbb47fb554 100644 --- a/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h +++ b/xfa/src/fxbarcode/oned/BC_OnedCodaBarReader.h @@ -7,9 +7,12 @@ #ifndef XFA_SRC_FXBARCODE_ONED_BC_ONEDCODABARREADER_H_ #define XFA_SRC_FXBARCODE_ONED_BC_ONEDCODABARREADER_H_ +#include "core/include/fxcrt/fx_basic.h" +#include "xfa/src/fxbarcode/oned/BC_OneDReader.h" + class CBC_CommonBitArray; class CBC_OneDReader; -class CBC_OnedCodaBarReader; + class CBC_OnedCodaBarReader : public CBC_OneDReader { public: CBC_OnedCodaBarReader(); -- cgit v1.2.3