~ballogy/gloobus-preview/drop-icns

« back to all changes in this revision

Viewing changes to src/document-plugin.cpp

  • Committer: Alexandr Grigorcea
  • Date: 2011-11-01 02:03:33 UTC
  • Revision ID: cahr.gr@gmail.com-20111101020333-ioyog4qg6nk289im
fixed segfault on docs with less pages than PAGE_PRELOADING

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
            }
135
135
 
136
136
            double available_width = ui->get_max_width();
137
 
            //double available_height = ui->get_max_height();
138
137
 
139
138
            if (available_width < max_width_) {
140
139
                scale_ = available_width / max_width_;
148
147
 
149
148
            TaskManager::add(new Task(bind(&loadPages, loader_, load_queue_, done_queue_)));
150
149
 
151
 
            for (int i=0; i<PAGE_PRELOADING; i++) {
 
150
            // lets preload a couple of first pages
 
151
            int stop = PAGE_PRELOADING;
 
152
            if (stop > (int)pages_.size()) {
 
153
                stop = pages_.size();
 
154
            }
 
155
            for (int i=0; i<stop; i++) {
152
156
                loadPage(i);
153
157
            }
154
158