Remove useless CBC_SymbolShapeHint.

Mark some methods as virtual/override in formerly CBC_SymbolShapeHint
derived classes.

Change-Id: Ia6d83e0b2c63c8fb440bc1d5beb258a796e1d42f
Reviewed-on: https://pdfium-review.googlesource.com/5738
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 53f4644..debeab9 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1303,7 +1303,6 @@
       "fxbarcode/datamatrix/BC_HighLevelEncoder.h",
       "fxbarcode/datamatrix/BC_SymbolInfo.cpp",
       "fxbarcode/datamatrix/BC_SymbolInfo.h",
-      "fxbarcode/datamatrix/BC_SymbolShapeHint.cpp",
       "fxbarcode/datamatrix/BC_SymbolShapeHint.h",
       "fxbarcode/datamatrix/BC_TextEncoder.cpp",
       "fxbarcode/datamatrix/BC_TextEncoder.h",
diff --git a/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp b/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp
index c0994af..1229321 100644
--- a/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp
+++ b/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.cpp
@@ -30,7 +30,7 @@
 
 CBC_DataMatrixSymbolInfo144::~CBC_DataMatrixSymbolInfo144() {}
 
-int32_t CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount() {
+int32_t CBC_DataMatrixSymbolInfo144::getInterleavedBlockCount() const {
   return 10;
 }
 
diff --git a/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h b/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h
index 18ef979..0a1c529 100644
--- a/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h
+++ b/fxbarcode/datamatrix/BC_DataMatrixSymbolInfo144.h
@@ -14,7 +14,7 @@
   CBC_DataMatrixSymbolInfo144();
   ~CBC_DataMatrixSymbolInfo144() override;
 
-  int32_t getInterleavedBlockCount();
+  int32_t getInterleavedBlockCount() const override;
 };
 
 #endif  // FXBARCODE_DATAMATRIX_BC_DATAMATRIXSYMBOLINFO144_H_
diff --git a/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp b/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
index 0754493..0177053 100644
--- a/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
+++ b/fxbarcode/datamatrix/BC_DataMatrixWriter.cpp
@@ -115,8 +115,7 @@
   if (outWidth < 0 || outHeight < 0)
     return nullptr;
 
-  CBC_SymbolShapeHint::SymbolShapeHint shape =
-      CBC_SymbolShapeHint::FORCE_SQUARE;
+  SymbolShapeHint shape = FORCE_SQUARE;
   CFX_WideString ecLevel;
   int32_t e = BCExceptionNO;
   CFX_WideString encoded =
diff --git a/fxbarcode/datamatrix/BC_EncoderContext.h b/fxbarcode/datamatrix/BC_EncoderContext.h
index e225933..6cb2b42 100644
--- a/fxbarcode/datamatrix/BC_EncoderContext.h
+++ b/fxbarcode/datamatrix/BC_EncoderContext.h
@@ -12,12 +12,12 @@
 
 class CBC_SymbolInfo;
 
-class CBC_EncoderContext : public CBC_SymbolShapeHint {
+class CBC_EncoderContext {
  public:
   CBC_EncoderContext(const CFX_WideString& msg,
                      const CFX_WideString& ecLevel,
                      int32_t& e);
-  ~CBC_EncoderContext() override;
+  ~CBC_EncoderContext();
 
   void setSymbolShape(SymbolShapeHint shape);
   void setSkipAtEnd(int32_t count);
@@ -34,7 +34,6 @@
   void updateSymbolInfo(int32_t len, int32_t& e);
   void resetSymbolInfo();
 
- public:
   CFX_WideString m_msg;
   CFX_WideString m_codewords;
   int32_t m_pos;
@@ -44,7 +43,6 @@
  private:
   int32_t getTotalMessageCharCount();
 
- private:
   SymbolShapeHint m_shape;
   int32_t m_skipAtEnd;
 };
diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/fxbarcode/datamatrix/BC_HighLevelEncoder.h
index 46789d6..cfcca18 100644
--- a/fxbarcode/datamatrix/BC_HighLevelEncoder.h
+++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.h
@@ -19,10 +19,10 @@
 #define EDIFACT_ENCODATION 4
 #define BASE256_ENCODATION 5
 
-class CBC_HighLevelEncoder : public CBC_SymbolShapeHint {
+class CBC_HighLevelEncoder {
  public:
   CBC_HighLevelEncoder();
-  ~CBC_HighLevelEncoder() override;
+  ~CBC_HighLevelEncoder();
 
   std::vector<uint8_t>& getBytesForMessage(CFX_WideString msg);
   static CFX_WideString encodeHighLevel(CFX_WideString msg,
diff --git a/fxbarcode/datamatrix/BC_SymbolInfo.h b/fxbarcode/datamatrix/BC_SymbolInfo.h
index 18d7b68..7b536ec 100644
--- a/fxbarcode/datamatrix/BC_SymbolInfo.h
+++ b/fxbarcode/datamatrix/BC_SymbolInfo.h
@@ -11,14 +11,14 @@
 #include "core/fxcrt/fx_system.h"
 #include "fxbarcode/datamatrix/BC_SymbolShapeHint.h"
 
-class CBC_SymbolInfo : public CBC_SymbolShapeHint {
+class CBC_SymbolInfo {
  public:
   CBC_SymbolInfo(int32_t dataCapacity,
                  int32_t errorCodewords,
                  int32_t matrixWidth,
                  int32_t matrixHeight,
                  int32_t dataRegions);
-  ~CBC_SymbolInfo() override;
+  virtual ~CBC_SymbolInfo();
 
   static void Initialize();
   static void Finalize();
@@ -41,7 +41,7 @@
   int32_t getSymbolWidth() const;
   int32_t getSymbolHeight() const;
   int32_t getCodewordCount() const;
-  int32_t getInterleavedBlockCount() const;
+  virtual int32_t getInterleavedBlockCount() const;
   int32_t getDataLengthForInterleavedBlock(int32_t index) const;
   int32_t getErrorLengthForInterleavedBlock(int32_t index) const;
 
diff --git a/fxbarcode/datamatrix/BC_SymbolShapeHint.cpp b/fxbarcode/datamatrix/BC_SymbolShapeHint.cpp
deleted file mode 100644
index 294580b..0000000
--- a/fxbarcode/datamatrix/BC_SymbolShapeHint.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-// Original code is licensed as follows:
-/*
- * Copyright 2007 Jeremias Maerki.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "fxbarcode/datamatrix/BC_SymbolShapeHint.h"
-
-CBC_SymbolShapeHint::CBC_SymbolShapeHint() {}
-CBC_SymbolShapeHint::~CBC_SymbolShapeHint() {}
diff --git a/fxbarcode/datamatrix/BC_SymbolShapeHint.h b/fxbarcode/datamatrix/BC_SymbolShapeHint.h
index 409ee05..3e93988 100644
--- a/fxbarcode/datamatrix/BC_SymbolShapeHint.h
+++ b/fxbarcode/datamatrix/BC_SymbolShapeHint.h
@@ -7,16 +7,10 @@
 #ifndef FXBARCODE_DATAMATRIX_BC_SYMBOLSHAPEHINT_H_
 #define FXBARCODE_DATAMATRIX_BC_SYMBOLSHAPEHINT_H_
 
-class CBC_SymbolShapeHint {
- public:
-  CBC_SymbolShapeHint();
-  virtual ~CBC_SymbolShapeHint();
-
-  enum SymbolShapeHint {
-    FORCE_NONE,
-    FORCE_SQUARE,
-    FORCE_RECTANGLE,
-  };
+enum SymbolShapeHint {
+  FORCE_NONE,
+  FORCE_SQUARE,
+  FORCE_RECTANGLE,
 };
 
 #endif  // FXBARCODE_DATAMATRIX_BC_SYMBOLSHAPEHINT_H_