Browse files

Bug fix of pages widths/heights map generation

  • Loading branch information...
1 parent 8b39592 commit 80649b259f658fad29dcaca5f083cca37752c89b @Simanas committed Dec 12, 2012
Showing with 8 additions and 8 deletions.
  1. +3 −3 src/util/Preprocessor.cc
  2. +5 −5 src/util/Preprocessor.h
View
6 src/util/Preprocessor.cc
@@ -88,9 +88,9 @@ void Preprocessor::drawChar(GfxState *state, double x, double y,
void Preprocessor::startPage(int pageNum, GfxState *state)
{
max_width = max<double>(max_width, state->getPageWidth());
- max_height = max<double>(max_height, state->getPageHeight());
- page_widths.push_back(state->getPageWidth());
- page_heights.push_back(state->getPageHeight());
+ max_height = max<double>(max_height, state->getPageHeight());
+ page_widths[pageNum] = state->getPageWidth();
+ page_heights[pageNum] = state->getPageHeight();
}
const char * Preprocessor::get_code_map (long long font_id) const
View
10 src/util/Preprocessor.h
@@ -20,11 +20,11 @@
#include <PDFDoc.h>
#include <Annot.h>
#include "Param.h"
-#include <vector>
+#include <map>
namespace pdf2htmlEX {
-using std::vector;
+using std::map;
class Preprocessor : public OutputDev {
public:
@@ -48,14 +48,14 @@ class Preprocessor : public OutputDev {
const char * get_code_map (long long font_id) const;
double get_max_width (void) const { return max_width; }
double get_max_height (void) const { return max_height; }
- double get_page_width (int page_number) { return page_widths.at(page_number-1); }
- double get_page_height (int page_number) { return page_heights.at(page_number-1); }
+ double get_page_width (int page_number) { return page_widths[page_number-1]; }
+ double get_page_height (int page_number) { return page_heights[page_number-1]; }
protected:
const Param * param;
double max_width, max_height;
- vector<int> page_widths, page_heights;
+ map<int,int> page_widths, page_heights;
long long cur_font_id;
char * cur_code_map;

0 comments on commit 80649b2

Please sign in to comment.