mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-12-11 23:19:04 +08:00
Use std::vector in TessPDFRenderer
Signed-off-by: Stefan Weil <sw@weil.de>
This commit is contained in:
parent
7c679e777d
commit
3ddc88cccb
@ -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.
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user