Remove m_currentRow from the state of CBC_BarcodeMatrix.

Change-Id: I2003d32f3f6972c0102b37ad545316a76b09fd1f
Reviewed-on: https://pdfium-review.googlesource.com/41030
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
diff --git a/fxbarcode/pdf417/BC_PDF417.cpp b/fxbarcode/pdf417/BC_PDF417.cpp
index 084f3a8..30b3f42 100644
--- a/fxbarcode/pdf417/BC_PDF417.cpp
+++ b/fxbarcode/pdf417/BC_PDF417.cpp
@@ -505,8 +505,9 @@
                                 CBC_BarcodeMatrix* logic) {
   int32_t idx = 0;
   for (int32_t y = 0; y < r; y++) {
+    CBC_BarcodeRow* logicRow = logic->getRow(y);
     int32_t cluster = y % 3;
-    encodeChar(START_PATTERN, 17, logic->getCurrentRow());
+    encodeChar(START_PATTERN, 17, logicRow);
     int32_t left;
     int32_t right;
     if (cluster == 0) {
@@ -520,20 +521,19 @@
       right = (30 * (y / 3)) + (errorCorrectionLevel * 3) + ((r - 1) % 3);
     }
     int32_t pattern = CODEWORD_TABLE[cluster][left];
-    encodeChar(pattern, 17, logic->getCurrentRow());
+    encodeChar(pattern, 17, logicRow);
     for (int32_t x = 0; x < c; x++) {
       pattern = CODEWORD_TABLE[cluster][fullCodewords[idx]];
-      encodeChar(pattern, 17, logic->getCurrentRow());
+      encodeChar(pattern, 17, logicRow);
       idx++;
     }
     if (m_compact) {
-      encodeChar(STOP_PATTERN, 1, logic->getCurrentRow());
+      encodeChar(STOP_PATTERN, 1, logicRow);
     } else {
       pattern = CODEWORD_TABLE[cluster][right];
-      encodeChar(pattern, 17, logic->getCurrentRow());
-      encodeChar(STOP_PATTERN, 18, logic->getCurrentRow());
+      encodeChar(pattern, 17, logicRow);
+      encodeChar(STOP_PATTERN, 18, logicRow);
     }
-    logic->nextRow();
   }
 }
 
diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
index 7fb1259..32db82e 100644
--- a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
+++ b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.cpp
@@ -33,10 +33,6 @@
 
 CBC_BarcodeMatrix::~CBC_BarcodeMatrix() {}
 
-void CBC_BarcodeMatrix::nextRow() {
-  ++m_currentRow;
-}
-
 std::vector<uint8_t>& CBC_BarcodeMatrix::getMatrix() {
   m_matrixOut.resize(m_width * m_height);
   for (size_t i = 0; i < m_height; ++i) {
diff --git a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
index badb0ce..bee2ef9 100644
--- a/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
+++ b/fxbarcode/pdf417/BC_PDF417BarcodeMatrix.h
@@ -17,16 +17,14 @@
   CBC_BarcodeMatrix(size_t height, size_t width);
   virtual ~CBC_BarcodeMatrix();
 
-  CBC_BarcodeRow* getCurrentRow() const { return m_matrix[m_currentRow].get(); }
+  CBC_BarcodeRow* getRow(size_t row) const { return m_matrix[row].get(); }
   size_t getWidth() const { return m_width; }
   size_t getHeight() const { return m_height; }
-  void nextRow();
   std::vector<uint8_t>& getMatrix();
 
  private:
   std::vector<std::unique_ptr<CBC_BarcodeRow>> m_matrix;
   std::vector<uint8_t> m_matrixOut;
-  size_t m_currentRow = 0;
   size_t m_width;
   size_t m_height;
 };