~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to libs/flake/KoCanvasBase.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "KoResourceManager.h"
23
23
#include "KoShapeController.h"
24
24
#include "KoCanvasController.h"
 
25
#include "KoViewConverter.h"
25
26
#include "KoSnapGuide.h"
26
27
#include "SnapGuideConfigWidget.h"
27
28
 
33
34
class KoCanvasBase::Private
34
35
{
35
36
public:
36
 
    Private() : shapeController(0), resourceManager(0), controller(0) {}
 
37
    Private() : shapeController(0),
 
38
        resourceManager(0),
 
39
        controller(0),
 
40
        snapGuide(0),
 
41
        readWrite(true)
 
42
    {
 
43
    }
37
44
    ~Private() {
38
45
        delete shapeController;
39
46
        delete resourceManager;
43
50
    KoResourceManager *resourceManager;
44
51
    KoCanvasController *controller;
45
52
    KoSnapGuide *snapGuide;
 
53
    bool readWrite;
46
54
};
47
55
 
48
56
KoCanvasBase::KoCanvasBase(KoShapeControllerBase *shapeControllerBase)
71
79
 
72
80
void KoCanvasBase::ensureVisible(const QRectF &rect)
73
81
{
74
 
    if (d->controller)
75
 
        d->controller->ensureVisible(rect);
 
82
    if (d->controller && d->controller->canvas())
 
83
        d->controller->ensureVisible(
 
84
                d->controller->canvas()->viewConverter()->documentToView(rect));
76
85
}
77
86
 
78
87
void KoCanvasBase::setCanvasController(KoCanvasController *controller)
103
112
{
104
113
    return new SnapGuideConfigWidget(d->snapGuide);
105
114
}
 
115
 
 
116
void KoCanvasBase::setReadWrite(bool readWrite)
 
117
{
 
118
    d->readWrite = readWrite;
 
119
}
 
120
 
 
121
bool KoCanvasBase::isReadWrite() const
 
122
{
 
123
    return d->readWrite;
 
124
}