~ubuntu-branches/ubuntu/vivid/qpdfview/vivid

« back to all changes in this revision

Viewing changes to sources/pdfmodel.cpp

  • Committer: Package Import Robot
  • Author(s): Benjamin Eltzner
  • Date: 2014-10-22 21:49:15 UTC
  • mfrom: (1.2.15)
  • Revision ID: package-import@ubuntu.com-20141022214915-agqeoe318lzs2s4d
Tags: 0.4.12-1
* New upstream release.
* Fixed option to zoom to selection and implemented tiled rendering
  (Closes: #739554)
* Enable support for qt5 and poppler-qt5.
* Explicit dependence on hicolor-icon-theme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
 
Copyright 2013 Adam Reichold
 
3
Copyright 2014 S. Razi Alavizadeh
 
4
Copyright 2013-2014 Adam Reichold
4
5
 
5
6
This file is part of qpdfview.
6
7
 
289
290
 
290
291
#endif // HAS_POPPLER_24
291
292
 
292
 
    double xres;
293
 
    double yres;
294
 
 
295
 
    switch(rotation)
296
 
    {
297
 
    default:
298
 
    case RotateBy0:
299
 
    case RotateBy180:
300
 
        xres = horizontalResolution;
301
 
        yres = verticalResolution;
302
 
        break;
303
 
    case RotateBy90:
304
 
    case RotateBy270:
305
 
        xres = verticalResolution;
306
 
        yres = horizontalResolution;
307
 
        break;
308
 
    }
309
 
 
310
293
    Poppler::Page::Rotation rotate;
311
294
 
312
295
    switch(rotation)
339
322
        h = boundingRect.height();
340
323
    }
341
324
 
342
 
    return m_page->renderToImage(xres, yres, x, y, w, h, rotate);
 
325
    return m_page->renderToImage(horizontalResolution, verticalResolution, x, y, w, h, rotate);
 
326
}
 
327
 
 
328
QString PdfPage::label() const
 
329
{
 
330
#ifndef HAS_POPPLER_24
 
331
 
 
332
    QMutexLocker mutexLocker(m_mutex);
 
333
 
 
334
#endif // HAS_POPPLER_24
 
335
 
 
336
    return m_page->label();
343
337
}
344
338
 
345
339
QList< Link* > PdfPage::links() const
450
444
        results.append(rect);
451
445
    }
452
446
 
453
 
#endif
 
447
#endif // HAS_POPPLER_22 HAS_POPPLER_14
454
448
 
455
449
    return results;
456
450
}
479
473
    return annotations;
480
474
}
481
475
 
482
 
bool Model::PdfPage::canAddAndRemoveAnnotations() const
 
476
bool PdfPage::canAddAndRemoveAnnotations() const
483
477
{
484
478
#ifdef HAS_POPPLER_20
485
479
 
807
801
 
808
802
void PdfDocument::loadFonts(QStandardItemModel* fontsModel) const
809
803
{
810
 
    Document::Document::loadFonts(fontsModel);
 
804
    Document::loadFonts(fontsModel);
811
805
 
812
806
#ifndef HAS_POPPLER_24
813
807
 
1054
1048
        document->setRenderHint(Poppler::Document::Antialiasing, m_settings->value("antialiasing", true).toBool());
1055
1049
        document->setRenderHint(Poppler::Document::TextAntialiasing, m_settings->value("textAntialiasing", true).toBool());
1056
1050
 
1057
 
#ifdef HAS_POPPLER_18
 
1051
#if defined(HAS_POPPLER_18)
1058
1052
 
1059
1053
        switch(m_settings->value("textHinting", 0).toInt())
1060
1054
        {
1072
1066
            break;
1073
1067
        }
1074
1068
 
1075
 
#else
 
1069
#elif defined(HAS_POPPLER_14)
1076
1070
 
1077
1071
        document->setRenderHint(Poppler::Document::TextHinting, m_settings->value("textHinting", false).toBool());
1078
1072
 
1079
 
#endif // HAS_POPPLER_18
 
1073
#endif // HAS_POPPLER_18 HAS_POPPLER_14
1080
1074
 
1081
1075
#ifdef HAS_POPPLER_22
1082
1076