summaryrefslogtreecommitdiff
path: root/fxbarcode/common
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-01 14:06:10 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-02 13:59:36 +0000
commit0804b3f5114ff09df9b10207997e1f16c868b45e (patch)
tree59c6a06f89fe78ccab51b954386a03d8d7625aa2 /fxbarcode/common
parent40baddef7fda756c29b813dc1fd67b28d745aa8c (diff)
downloadpdfium-0804b3f5114ff09df9b10207997e1f16c868b45e.tar.xz
Remove more |new|s, part 7
Remove some dead code along the way. Move some getters to headers and make const. Change-Id: I14280c247b0cfeff8ad7f606302bc8bba1960f1e Reviewed-on: https://pdfium-review.googlesource.com/4730 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fxbarcode/common')
-rw-r--r--fxbarcode/common/BC_CommonBitMatrix.cpp32
-rw-r--r--fxbarcode/common/BC_CommonBitMatrix.h10
2 files changed, 8 insertions, 34 deletions
diff --git a/fxbarcode/common/BC_CommonBitMatrix.cpp b/fxbarcode/common/BC_CommonBitMatrix.cpp
index fe3546156e..6fe447db6f 100644
--- a/fxbarcode/common/BC_CommonBitMatrix.cpp
+++ b/fxbarcode/common/BC_CommonBitMatrix.cpp
@@ -20,9 +20,11 @@
* limitations under the License.
*/
-#include "fxbarcode/common/BC_CommonBitArray.h"
#include "fxbarcode/common/BC_CommonBitMatrix.h"
+
+#include "fxbarcode/common/BC_CommonBitArray.h"
#include "fxbarcode/utils.h"
+#include "third_party/base/ptr_util.h"
CBC_CommonBitMatrix::CBC_CommonBitMatrix() {}
@@ -55,10 +57,6 @@ bool CBC_CommonBitMatrix::Get(int32_t x, int32_t y) const {
return ((((uint32_t)m_bits[offset]) >> (x & 0x1f)) & 1) != 0;
}
-int32_t* CBC_CommonBitMatrix::GetBits() {
- return m_bits;
-}
-
void CBC_CommonBitMatrix::Set(int32_t x, int32_t y) {
int32_t offset = y * m_rowSize + (x >> 5);
if (offset >= m_rowSize * m_height || offset < 0)
@@ -95,20 +93,6 @@ bool CBC_CommonBitMatrix::SetRegion(int32_t left,
return true;
}
-CBC_CommonBitArray* CBC_CommonBitMatrix::GetRow(int32_t y,
- CBC_CommonBitArray* row) {
- CBC_CommonBitArray* rowArray = nullptr;
- if (!row || static_cast<int32_t>(row->GetSize()) < m_width) {
- rowArray = new CBC_CommonBitArray(m_width);
- } else {
- rowArray = new CBC_CommonBitArray(row);
- }
- int32_t offset = y * m_rowSize;
- for (int32_t x = 0; x < m_rowSize; x++)
- rowArray->SetBulk(x << 5, m_bits[offset + x]);
- return rowArray;
-}
-
void CBC_CommonBitMatrix::SetRow(int32_t y, CBC_CommonBitArray* row) {
int32_t l = y * m_rowSize;
for (int32_t i = 0; i < m_rowSize; i++) {
@@ -121,13 +105,3 @@ void CBC_CommonBitMatrix::SetCol(int32_t y, CBC_CommonBitArray* col) {
for (size_t i = 0; i < col->GetBits().size(); ++i)
m_bits[i * m_rowSize + y] = col->GetBitArray()[i];
}
-
-int32_t CBC_CommonBitMatrix::GetWidth() const {
- return m_width;
-}
-int32_t CBC_CommonBitMatrix::GetHeight() const {
- return m_height;
-}
-int32_t CBC_CommonBitMatrix::GetRowSize() const {
- return m_rowSize;
-}
diff --git a/fxbarcode/common/BC_CommonBitMatrix.h b/fxbarcode/common/BC_CommonBitMatrix.h
index 744461903d..67c0f888cc 100644
--- a/fxbarcode/common/BC_CommonBitMatrix.h
+++ b/fxbarcode/common/BC_CommonBitMatrix.h
@@ -7,6 +7,8 @@
#ifndef FXBARCODE_COMMON_BC_COMMONBITMATRIX_H_
#define FXBARCODE_COMMON_BC_COMMONBITMATRIX_H_
+#include <memory>
+
#include "core/fxcrt/fx_system.h"
class CBC_CommonBitArray;
@@ -24,14 +26,12 @@ class CBC_CommonBitMatrix {
void Flip(int32_t x, int32_t y);
void Clear();
bool SetRegion(int32_t left, int32_t top, int32_t width, int32_t height);
- CBC_CommonBitArray* GetRow(int32_t y, CBC_CommonBitArray* row);
void SetRow(int32_t y, CBC_CommonBitArray* row);
CBC_CommonBitArray* GetCol(int32_t y, CBC_CommonBitArray* row);
void SetCol(int32_t y, CBC_CommonBitArray* col);
- int32_t GetWidth() const;
- int32_t GetHeight() const;
- int32_t GetRowSize() const;
- int32_t* GetBits();
+ int32_t GetWidth() const { return m_width; }
+ int32_t GetHeight() const { return m_height; }
+ int32_t* GetBits() const { return m_bits; }
private:
int32_t m_width = 0;