~ubuntu-branches/debian/sid/scribus/sid

« back to all changes in this revision

Viewing changes to scribus/navigator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Oleksandr Moskalenko
  • Date: 2008-07-02 13:42:07 UTC
  • mto: (4.1.1 sid) (20.1.1 experimental) (1.2.1)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080702134207-h9h384v0wxjmaf8y
Tags: upstream-1.3.3.12.dfsg
ImportĀ upstreamĀ versionĀ 1.3.3.12.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
 
3
to the COPYING file provided with the program. Following this notice may exist
 
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
 
5
for which a new license (GPL+exception) is in place.
 
6
*/
1
7
/***************************************************************************
2
8
                          navigator.cpp  -  description
3
9
                             -------------------
17
23
 
18
24
#include "navigator.h"
19
25
#include "navigator.moc"
20
 
extern QPixmap LoadPDF(QString fn, int Seite, int Size, int *w, int *h);
 
26
 
 
27
#include <qpainter.h>
 
28
#include "scribusview.h"
 
29
#include "gsutil.h"
21
30
 
22
31
Navigator::Navigator(QWidget *parent, int Size, int Seite, ScribusView* vie, QString fn) : QLabel(parent)
23
32
{
24
33
        setScaledContents(false);
25
34
        setAlignment(static_cast<int>( QLabel::AlignLeft | QLabel::AlignTop) );
26
 
        if (fn != "")
 
35
        if (!fn.isEmpty())
27
36
        {
28
37
                QPixmap img = LoadPDF(fn, Seite, Size, &Breite, &Hoehe);
29
38
                if (!img.isNull())
32
41
                        pmx = LoadPDF(fn, 1, Size, &Breite, &Hoehe);
33
42
        }
34
43
        else
35
 
                pmx = vie->PageToPixmap(Seite, Size);
 
44
                pmx.convertFromImage(vie->PageToPixmap(Seite, Size));
36
45
        resize(pmx.width(), pmx.height());
37
46
        Xp = 0;
38
47
        Yp = 0;
73
82
{
74
83
        QPainter p;
75
84
        p.begin(this);
 
85
        p.eraseRect(pmx.rect());
76
86
        p.setClipRect(pmx.rect());
77
87
        p.drawPixmap(0, 0, pmx);
78
88
        p.setPen(QPen(QColor(black), 1, SolidLine, FlatCap, MiterJoin));
86
96
bool Navigator::SetSeite(int Seite, int Size, QString fn)
87
97
{
88
98
        bool ret = false;
89
 
        if (fn != "")
 
99
        if (!fn.isEmpty())
90
100
        {
91
101
                QPixmap img = LoadPDF(fn, Seite, Size, &Breite, &Hoehe);
92
102
                if (!img.isNull())
99
109
        }
100
110
        else
101
111
        {
102
 
                pmx = view->PageToPixmap(Seite, Size);
 
112
                pmx.convertFromImage(view->PageToPixmap(Seite, Size));
103
113
                ret = true;
104
114
        }
105
115
        resize(pmx.width(), pmx.height());