Use std::vector in TessPDFRenderer

Signed-off-by: Stefan Weil <sw@weil.de>
This commit is contained in:
Stefan Weil 2020-12-26 22:35:54 +01:00
parent 7c679e777d
commit 3ddc88cccb
2 changed files with 5 additions and 4 deletions

View File

@ -25,6 +25,7 @@
// complexity of includes here. Use forward declarations wherever possible
// and hide includes of complex types in baseapi.cpp.
#include <string> // for std::string
#include <vector> // for std::vector
struct Pix;
@ -230,8 +231,8 @@ class TESS_API TessPDFRenderer : public TessResultRenderer {
// used to make everything that isn't easily handled in a
// streaming fashion.
long int obj_; // counter for PDF objects
GenericVector<long int> offsets_; // offset of every PDF object in bytes
GenericVector<long int> pages_; // object number for every /Page object
std::vector<long int> offsets_; // offset of every PDF object in bytes
std::vector<long int> pages_; // object number for every /Page object
std::string datadir_; // where to find the custom font
bool textonly_; // skip images if set
// Bookkeeping only. DIY = Do It Yourself.

View File

@ -891,9 +891,9 @@ bool TessPDFRenderer::EndDocumentHandler() {
stream << kPagesObjectNumber << " 0 obj\n<<\n /Type /Pages\n /Kids [ ";
AppendString(stream.str().c_str());
size_t pages_objsize = stream.str().size();
for (size_t i = 0; i < pages_.unsigned_size(); i++) {
for (const auto& page : pages_) {
stream.str("");
stream << pages_[i] << " 0 R ";
stream << page << " 0 R ";
AppendString(stream.str().c_str());
pages_objsize += stream.str().size();
}