Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-impress-support-mp-review into lp:~mrqtros/ubuntu-docviewer-app/reboot-qsg-impress-support
- reboot-impress-support-mp-review
- Merge into reboot-qsg-impress-support
Proposed by
Stefano Verzegnassi
Status: | Merged |
---|---|
Approved by: | Roman Shchekin |
Approved revision: | 191 |
Merged at revision: | 187 |
Proposed branch: | lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-impress-support-mp-review |
Merge into: | lp:~mrqtros/ubuntu-docviewer-app/reboot-qsg-impress-support |
Diff against target: |
599 lines (+149/-121) 13 files modified
po/com.ubuntu.docviewer.pot (+33/-20) src/app/qml/loView/LOViewDefaultHeader.qml (+40/-48) src/app/qml/loView/LOViewGotoDialog.qml (+64/-0) src/app/qml/loView/LOViewPage.qml (+3/-3) src/app/qml/loView/PartsView.qml (+1/-1) src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp (+0/-11) src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.cpp (+0/-4) src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.h (+0/-6) src/plugin/libreofficetoolkit-qml-plugin/loview.cpp (+5/-12) src/plugin/libreofficetoolkit-qml-plugin/loview.h (+0/-1) src/plugin/libreofficetoolkit-qml-plugin/renderengine.cpp (+0/-6) src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp (+3/-3) src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.h (+0/-6) |
To merge this branch: | bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-impress-support-mp-review |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Roman Shchekin | Pending | ||
Review via email: mp+274068@code.launchpad.net |
Commit message
Minor fixes
Description of the change
Just removed some deprecated code/comments, merged 'reboot' branch, updated translation template, fixed conflicts.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'po/com.ubuntu.docviewer.pot' |
2 | --- po/com.ubuntu.docviewer.pot 2015-10-08 20:53:25 +0000 |
3 | +++ po/com.ubuntu.docviewer.pot 2015-10-11 12:52:09 +0000 |
4 | @@ -8,7 +8,7 @@ |
5 | msgstr "" |
6 | "Project-Id-Version: \n" |
7 | "Report-Msgid-Bugs-To: \n" |
8 | -"POT-Creation-Date: 2015-10-08 23:48+0300\n" |
9 | +"POT-Creation-Date: 2015-10-11 13:31+0200\n" |
10 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
11 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
12 | "Language-Team: LANGUAGE <LL@li.org>\n" |
13 | @@ -19,7 +19,7 @@ |
14 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
15 | |
16 | #: ../src/app/docviewer-application.cpp:162 |
17 | -#: /home/qtros/dev/build-reboot-qsg-impress-support-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1 |
18 | +#: /tmp/build-reboot-qsg-impress-support-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1 |
19 | msgid "Document Viewer" |
20 | msgstr "" |
21 | |
22 | @@ -63,7 +63,7 @@ |
23 | #: ../src/app/qml/common/RejectedImportDialog.qml:38 |
24 | #: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:32 |
25 | #: ../src/app/qml/documentPage/SortSettingsDialog.qml:53 |
26 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:79 |
27 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:78 |
28 | #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61 |
29 | #: ../src/app/qml/textView/TextViewDefaultHeader.qml:61 |
30 | msgid "Close" |
31 | @@ -151,6 +151,7 @@ |
32 | |
33 | #: ../src/app/qml/documentPage/DeleteFileDialog.qml:44 |
34 | #: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28 |
35 | +#: ../src/app/qml/loView/LOViewGotoDialog.qml:54 |
36 | #: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:52 |
37 | msgid "Cancel" |
38 | msgstr "" |
39 | @@ -253,7 +254,7 @@ |
40 | msgstr "" |
41 | |
42 | #: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27 |
43 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:79 |
44 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:78 |
45 | #: ../src/app/qml/loView/LOViewPage.qml:191 |
46 | #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61 |
47 | #: ../src/app/qml/textView/TextViewDefaultHeader.qml:61 |
48 | @@ -305,42 +306,41 @@ |
49 | msgid "Reverse order" |
50 | msgstr "" |
51 | |
52 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:56 |
53 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55 |
54 | #: ../src/app/qml/textView/TextView.qml:42 |
55 | msgid "Loading..." |
56 | msgstr "" |
57 | |
58 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:60 |
59 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59 |
60 | msgid "LibreOffice text document" |
61 | msgstr "" |
62 | |
63 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:62 |
64 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61 |
65 | msgid "LibreOffice spread sheet" |
66 | msgstr "" |
67 | |
68 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:64 |
69 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63 |
70 | msgid "LibreOffice presentation" |
71 | msgstr "" |
72 | |
73 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:66 |
74 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65 |
75 | msgid "LibreOffice Draw document" |
76 | msgstr "" |
77 | |
78 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:68 |
79 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:67 |
80 | msgid "Unknown LibreOffice document" |
81 | msgstr "" |
82 | |
83 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:70 |
84 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:69 |
85 | msgid "Unknown type document" |
86 | msgstr "" |
87 | |
88 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:95 |
89 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:94 |
90 | msgid "Show zoom controls" |
91 | msgstr "" |
92 | |
93 | -#: ../src/app/qml/loView/LOViewDefaultHeader.qml:102 |
94 | -#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:85 |
95 | -msgid "Go to page..." |
96 | +#: ../src/app/qml/loView/LOViewDefaultHeader.qml:101 |
97 | +msgid "Go to position..." |
98 | msgstr "" |
99 | |
100 | #: ../src/app/qml/loView/LOViewDefaultHeader.qml:108 |
101 | @@ -355,6 +355,19 @@ |
102 | msgid "Enable night mode" |
103 | msgstr "" |
104 | |
105 | +#: ../src/app/qml/loView/LOViewGotoDialog.qml:27 |
106 | +msgid "Go to position" |
107 | +msgstr "" |
108 | + |
109 | +#: ../src/app/qml/loView/LOViewGotoDialog.qml:28 |
110 | +msgid "Choose a position between 1% and 100%" |
111 | +msgstr "" |
112 | + |
113 | +#: ../src/app/qml/loView/LOViewGotoDialog.qml:46 |
114 | +#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:44 |
115 | +msgid "GO!" |
116 | +msgstr "" |
117 | + |
118 | #: ../src/app/qml/loView/LOViewPage.qml:34 |
119 | #: ../src/app/qml/loView/LOViewPage.qml:189 |
120 | msgid "Slides" |
121 | @@ -408,6 +421,10 @@ |
122 | msgid "Page %1 of %2" |
123 | msgstr "" |
124 | |
125 | +#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:85 |
126 | +msgid "Go to page..." |
127 | +msgstr "" |
128 | + |
129 | #: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:25 |
130 | msgid "Go to page" |
131 | msgstr "" |
132 | @@ -417,10 +434,6 @@ |
133 | msgid "Choose a page between 1 and %1" |
134 | msgstr "" |
135 | |
136 | -#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:44 |
137 | -msgid "GO!" |
138 | -msgstr "" |
139 | - |
140 | #. TRANSLATORS: This string is used for renaming a copied file, |
141 | #. when a file with the same name already exists in user's |
142 | #. Documents folder. |
143 | @@ -435,6 +448,6 @@ |
144 | msgid "copy %1" |
145 | msgstr "" |
146 | |
147 | -#: /home/qtros/dev/build-reboot-qsg-impress-support-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2 |
148 | +#: /tmp/build-reboot-qsg-impress-support-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2 |
149 | msgid "documents;viewer;pdf;reader;" |
150 | msgstr "" |
151 | |
152 | === modified file 'src/app/qml/loView/LOViewDefaultHeader.qml' |
153 | --- src/app/qml/loView/LOViewDefaultHeader.qml 2015-09-22 19:02:46 +0000 |
154 | +++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-11 12:52:09 +0000 |
155 | @@ -16,64 +16,55 @@ |
156 | |
157 | import QtQuick 2.3 |
158 | import Ubuntu.Components 1.1 |
159 | -import QtQuick.Layouts 1.1 |
160 | import Ubuntu.Components.Popups 1.0 |
161 | +import DocumentViewer.LibreOffice 1.0 as LibreOffice |
162 | |
163 | PageHeadState { |
164 | id: rootItem |
165 | |
166 | property Page targetPage |
167 | - property alias activityRunning: activity.running |
168 | - |
169 | head: targetPage.head |
170 | |
171 | - contents: RowLayout { |
172 | - anchors.fill: parent |
173 | - spacing: units.gu(1) |
174 | - |
175 | - ActivityIndicator { id: activity } |
176 | - |
177 | - Column { |
178 | - id: layout |
179 | - Layout.fillWidth: true |
180 | - |
181 | - Label { |
182 | - width: parent.width |
183 | - //horizontalAlignment: Text.AlignHCenter |
184 | - elide: Text.ElideMiddle |
185 | - |
186 | - font.weight: Font.DemiBold |
187 | - text: targetPage.title |
188 | - } |
189 | - Label { |
190 | - width: parent.width |
191 | - //horizontalAlignment: Text.AlignHCenter |
192 | - elide: Text.ElideMiddle |
193 | - |
194 | - fontSize: "small" |
195 | - text: { |
196 | - if (!loPageContentLoader.item) |
197 | - return i18n.tr("Loading...") |
198 | - |
199 | - switch(loPageContentLoader.item.loDocument.documentType) { |
200 | - case 0: |
201 | - return i18n.tr("LibreOffice text document") |
202 | - case 1: |
203 | - return i18n.tr("LibreOffice spread sheet") |
204 | - case 2: |
205 | - return i18n.tr("LibreOffice presentation") |
206 | - case 3: |
207 | - return i18n.tr("LibreOffice Draw document") |
208 | - case 4: |
209 | - return i18n.tr("Unknown LibreOffice document") |
210 | - default: |
211 | - return i18n.tr("Unknown type document") |
212 | - } |
213 | + contents: Column { |
214 | + anchors { |
215 | + left: parent.left |
216 | + right: parent.right |
217 | + verticalCenter: parent.verticalCenter |
218 | + } |
219 | + |
220 | + Label { |
221 | + anchors { left: parent.left; right: parent.right } |
222 | + elide: Text.ElideMiddle |
223 | + font.weight: Font.DemiBold |
224 | + text: targetPage.title |
225 | + } |
226 | + Label { |
227 | + anchors { left: parent.left; right: parent.right } |
228 | + elide: Text.ElideMiddle |
229 | + fontSize: "small" |
230 | + text: { |
231 | + if (!loPageContentLoader.item) |
232 | + return i18n.tr("Loading...") |
233 | + |
234 | + switch(loPageContentLoader.item.loDocument.documentType) { |
235 | + case 0: |
236 | + return i18n.tr("LibreOffice text document") |
237 | + case 1: |
238 | + return i18n.tr("LibreOffice spread sheet") |
239 | + case 2: |
240 | + return i18n.tr("LibreOffice presentation") |
241 | + case 3: |
242 | + return i18n.tr("LibreOffice Draw document") |
243 | + case 4: |
244 | + return i18n.tr("Unknown LibreOffice document") |
245 | + default: |
246 | + return i18n.tr("Unknown type document") |
247 | } |
248 | } |
249 | } |
250 | } |
251 | |
252 | + |
253 | backAction: Action { |
254 | iconName: "back" |
255 | text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close") |
256 | @@ -97,10 +88,11 @@ |
257 | }, |
258 | |
259 | Action { |
260 | - objectName:"gotopage" |
261 | + objectName: "gotopage" |
262 | iconName: "browser-tabs" |
263 | - text: i18n.tr("Go to page...") |
264 | - enabled: false |
265 | + text: i18n.tr("Go to position...") |
266 | + onTriggered: PopupUtils.open(Qt.resolvedUrl("LOViewGotoDialog.qml"), targetPage) |
267 | + visible: loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.TextDocument |
268 | }, |
269 | |
270 | Action { |
271 | |
272 | === added file 'src/app/qml/loView/LOViewGotoDialog.qml' |
273 | --- src/app/qml/loView/LOViewGotoDialog.qml 1970-01-01 00:00:00 +0000 |
274 | +++ src/app/qml/loView/LOViewGotoDialog.qml 2015-10-11 12:52:09 +0000 |
275 | @@ -0,0 +1,64 @@ |
276 | +/* |
277 | + * Copyright (C) 2014-2015 Canonical, Ltd. |
278 | + * |
279 | + * This program is free software; you can redistribute it and/or modify |
280 | + * it under the terms of the GNU General Public License as published by |
281 | + * the Free Software Foundation; version 3. |
282 | + * |
283 | + * This program is distributed in the hope that it will be useful, |
284 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
285 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
286 | + * GNU General Public License for more details. |
287 | + * |
288 | + * You should have received a copy of the GNU General Public License |
289 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
290 | + */ |
291 | + |
292 | +import QtQuick 2.3 |
293 | +import Ubuntu.Components 1.1 |
294 | +import Ubuntu.Components.Popups 1.0 |
295 | + |
296 | +// TODO: Use page breaks detection, when LibreOfficeKit will support it. |
297 | + |
298 | +Dialog { |
299 | + id: goToPageDialog |
300 | + objectName: "LOViewGotoDialog" |
301 | + |
302 | + title: i18n.tr("Go to position") |
303 | + text: i18n.tr("Choose a position between 1% and 100%") |
304 | + |
305 | + TextField { |
306 | + id: goToPageTextField |
307 | + objectName:"goToPageTextField" |
308 | + |
309 | + width: parent.width |
310 | + |
311 | + hasClearButton: true |
312 | + inputMethodHints: Qt.ImhFormattedNumbersOnly |
313 | + validator: IntValidator{ bottom: 1; top: 100 } |
314 | + |
315 | + Keys.onReturnPressed: goToPage() |
316 | + Component.onCompleted: forceActiveFocus() |
317 | + } |
318 | + |
319 | + Button { |
320 | + objectName:"GOButton" |
321 | + text: i18n.tr("GO!") |
322 | + color: UbuntuColors.green |
323 | + |
324 | + enabled: goToPageTextField.acceptableInput |
325 | + onClicked: goToPage() |
326 | + } |
327 | + |
328 | + Button { |
329 | + text: i18n.tr("Cancel") |
330 | + onClicked: PopupUtils.close(goToPageDialog) |
331 | + } |
332 | + |
333 | + function goToPage() { |
334 | + var pos = loView.contentHeight * parseInt(goToPageTextField.text) / 100 |
335 | + |
336 | + loView.contentY = Math.min(pos, (loView.contentHeight - loView.height)) |
337 | + PopupUtils.close(goToPageDialog) |
338 | + } |
339 | +} |
340 | |
341 | === modified file 'src/app/qml/loView/LOViewPage.qml' |
342 | --- src/app/qml/loView/LOViewPage.qml 2015-10-05 06:42:33 +0000 |
343 | +++ src/app/qml/loView/LOViewPage.qml 2015-10-11 12:52:09 +0000 |
344 | @@ -99,8 +99,8 @@ |
345 | left: parent.left |
346 | } |
347 | |
348 | - model: loView.partsModel //LO.PartsModel { document: loPageContent.loDocument } |
349 | - visible: /*loView.partsModel &&*/ loDocument.documentType == LO.Document.PresentationDocument |
350 | + model: loView.partsModel |
351 | + visible: loDocument.documentType == LO.Document.PresentationDocument |
352 | width: visible ? units.gu(40) : 0 |
353 | } |
354 | |
355 | @@ -198,7 +198,7 @@ |
356 | PartsView { |
357 | property bool belongsToNestedPage: true |
358 | anchors.fill: parent |
359 | - model: loView.partsModel //LO.PartsModel { document: loPageContent.loDocument } |
360 | + model: loView.partsModel |
361 | } |
362 | } |
363 | } |
364 | |
365 | === modified file 'src/app/qml/loView/PartsView.qml' |
366 | --- src/app/qml/loView/PartsView.qml 2015-10-06 19:12:28 +0000 |
367 | +++ src/app/qml/loView/PartsView.qml 2015-10-11 12:52:09 +0000 |
368 | @@ -38,7 +38,7 @@ |
369 | height: units.gu(16) |
370 | |
371 | color: (loView.document.currentPart === model.index) ? Theme.palette.selected.background |
372 | - : "transparent" |
373 | + : "transparent" |
374 | |
375 | AbstractButton { |
376 | objectName: "abstractbutton" |
377 | |
378 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp' |
379 | --- src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp 2015-10-08 20:53:25 +0000 |
380 | +++ src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp 2015-10-11 12:52:09 +0000 |
381 | @@ -134,16 +134,11 @@ |
382 | return QSize(pWidth, pHeight); |
383 | } |
384 | |
385 | -// Paint a tile, with size=canvasSize, of the part of the document defined by |
386 | -// the rect tileSize. |
387 | QImage LODocument::paintTile(const QSize& canvasSize, const QRect& tileSize, const qreal &zoom) |
388 | { |
389 | if (!m_document) |
390 | return QImage(); |
391 | |
392 | -// if (m_currentPart != m_document->getPart()) |
393 | -// m_document->setPart(m_currentPart); |
394 | - |
395 | QImage result = QImage(canvasSize.width(), canvasSize.height(), QImage::Format_RGB32); |
396 | |
397 | #ifdef DEBUG_TILE_BENCHMARK |
398 | @@ -215,12 +210,6 @@ |
399 | return QString::fromUtf8(m_document->getPartName(index)); |
400 | } |
401 | |
402 | -/* Export the file in a given format: |
403 | - * - url is a mandatory argument. |
404 | - * - format is optional. If not specified, lok will try to get it from the file |
405 | - * extension given at the 'url' argument. |
406 | - * - filerOptions is also optional. |
407 | - */ |
408 | // TODO: Is there some documentation on safe formats or filterOptions that can |
409 | // be used? |
410 | bool LODocument::saveAs(QString url, QString format = QString(), QString filterOptions = QString()) |
411 | |
412 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.cpp' |
413 | --- src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.cpp 2015-10-06 20:11:45 +0000 |
414 | +++ src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.cpp 2015-10-11 12:52:09 +0000 |
415 | @@ -19,12 +19,8 @@ |
416 | #include "lodocument.h" |
417 | #include "lopartsimageprovider.h" |
418 | |
419 | -#include <QQmlContext> |
420 | -#include <QQmlEngine> |
421 | #include <QDebug> |
422 | |
423 | - |
424 | - |
425 | LOPartsModel::LOPartsModel(const QSharedPointer<LODocument>& document, QAbstractListModel *parent): |
426 | QAbstractListModel(parent) |
427 | { |
428 | |
429 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.h' |
430 | --- src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.h 2015-10-06 19:12:28 +0000 |
431 | +++ src/plugin/libreofficetoolkit-qml-plugin/lopartsmodel.h 2015-10-11 12:52:09 +0000 |
432 | @@ -19,7 +19,6 @@ |
433 | #define LOPARTSMODEL_H |
434 | |
435 | #include <QAbstractListModel> |
436 | -#include <QImage> |
437 | #include <QHash> |
438 | #include <QSharedPointer> |
439 | |
440 | @@ -46,7 +45,6 @@ |
441 | { |
442 | Q_OBJECT |
443 | Q_DISABLE_COPY(LOPartsModel) |
444 | - // Q_PROPERTY(LODocument* document READ document WRITE setDocument NOTIFY documentChanged) |
445 | Q_PROPERTY(int count READ rowCount NOTIFY countChanged) |
446 | |
447 | public: |
448 | @@ -60,9 +58,6 @@ |
449 | explicit LOPartsModel(const QSharedPointer<LODocument>& document, QAbstractListModel *parent = 0); |
450 | ~LOPartsModel(); |
451 | |
452 | - // LODocument* document() { return m_document; } |
453 | - //void setDocument(LODocument* document); |
454 | - |
455 | QHash<int, QByteArray> roleNames() const; |
456 | |
457 | int rowCount(const QModelIndex & parent = QModelIndex()) const; |
458 | @@ -73,7 +68,6 @@ |
459 | void notifyAboutChanges(int id); |
460 | |
461 | Q_SIGNALS: |
462 | - // void documentChanged(); |
463 | void countChanged(); |
464 | |
465 | private slots: |
466 | |
467 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/loview.cpp' |
468 | --- src/plugin/libreofficetoolkit-qml-plugin/loview.cpp 2015-10-06 20:11:45 +0000 |
469 | +++ src/plugin/libreofficetoolkit-qml-plugin/loview.cpp 2015-10-11 12:52:09 +0000 |
470 | @@ -20,7 +20,6 @@ |
471 | #include "twips.h" |
472 | #include "config.h" |
473 | |
474 | -#include <QPainter> |
475 | #include <QImage> |
476 | #include <QTimer> |
477 | #include <QtCore/qmath.h> |
478 | @@ -196,7 +195,6 @@ |
479 | return false; |
480 | } |
481 | |
482 | -// Update the size of LOView, according to the size of the loaded document. |
483 | void LOView::updateViewSize() |
484 | { |
485 | if (!m_document) |
486 | @@ -207,13 +205,9 @@ |
487 | this->setWidth(Twips::convertTwipsToPixels(docSize.width(), m_zoomFactor)); |
488 | this->setHeight(Twips::convertTwipsToPixels(docSize.height(), m_zoomFactor)); |
489 | |
490 | - // TODO: Consider to use connections to widthChanged and heightChanged |
491 | - this->updateVisibleRect(); |
492 | + updateVisibleRect(); |
493 | } |
494 | |
495 | -// Update the informations of the currently visible area of the parent |
496 | -// Flickable, then generate/delete all the required tiles, according to these |
497 | -// informations. |
498 | void LOView::updateVisibleRect() |
499 | { |
500 | if (!m_parentFlickable) |
501 | @@ -251,10 +245,10 @@ |
502 | m_parentFlickable->height()); |
503 | |
504 | // Update information about the buffer area |
505 | - m_bufferArea.setRect(qMax(0, m_visibleArea.x() - this->cacheBuffer()), |
506 | - qMax(0, m_visibleArea.y() - this->cacheBuffer()), |
507 | - qMin(int(this->width() - m_bufferArea.x()), m_visibleArea.width() + (this->cacheBuffer() * 2)), |
508 | - qMin(int(this->height() - m_bufferArea.y()), m_visibleArea.height() + (this->cacheBuffer() * 2))); |
509 | + m_bufferArea.setRect(qMax(0, m_visibleArea.x() - m_cacheBuffer), |
510 | + qMax(0, m_visibleArea.y() - m_cacheBuffer), |
511 | + qMin(int(this->width() - m_bufferArea.x()), m_visibleArea.width() + (m_cacheBuffer * 2)), |
512 | + qMin(int(this->height() - m_bufferArea.y()), m_visibleArea.height() + (m_cacheBuffer * 2))); |
513 | |
514 | // Delete tiles that are outside the loading area |
515 | if (!m_tiles.isEmpty()) { |
516 | @@ -323,7 +317,6 @@ |
517 | } |
518 | } |
519 | |
520 | -// FIXME: Just for the moment. In zoom branch we have all we need :) |
521 | void LOView::invalidateAllTiles() |
522 | { |
523 | clearView(); |
524 | |
525 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/loview.h' |
526 | --- src/plugin/libreofficetoolkit-qml-plugin/loview.h 2015-10-06 20:11:45 +0000 |
527 | +++ src/plugin/libreofficetoolkit-qml-plugin/loview.h 2015-10-11 12:52:09 +0000 |
528 | @@ -17,7 +17,6 @@ |
529 | #ifndef LOVIEW_H |
530 | #define LOVIEW_H |
531 | |
532 | -#include <QQuickPaintedItem> |
533 | #include <QQuickItem> |
534 | #include <QTimer> |
535 | #include <QSharedPointer> |
536 | |
537 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/renderengine.cpp' |
538 | --- src/plugin/libreofficetoolkit-qml-plugin/renderengine.cpp 2015-10-05 22:27:07 +0000 |
539 | +++ src/plugin/libreofficetoolkit-qml-plugin/renderengine.cpp 2015-10-11 12:52:09 +0000 |
540 | @@ -83,11 +83,5 @@ |
541 | QMetaObject::invokeMethod(this, "internalRenderCallback", |
542 | Q_ARG(int, task.id), Q_ARG(QImage, img), Q_ARG(bool, task.isThumbnail)); |
543 | } |
544 | -// QImage img = task.isThumbnail ? |
545 | -// //task.document->paintThumbnail(task.size) : |
546 | -// task.document->paintTile(task.area.size(), task.area, task.zoom) : |
547 | -// task.document->paintTile(task.area.size(), task.area, task.zoom); |
548 | -// QMetaObject::invokeMethod(this, "internalRenderCallback", |
549 | -// Q_ARG(int, task.id), Q_ARG(QImage, img), Q_ARG(bool, task.isThumbnail)); |
550 | }); |
551 | } |
552 | |
553 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp' |
554 | --- src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp 2015-10-05 06:42:33 +0000 |
555 | +++ src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.cpp 2015-10-11 12:52:09 +0000 |
556 | @@ -1,15 +1,15 @@ |
557 | #include "sgtileitem.h" |
558 | - |
559 | #include "lodocument.h" |
560 | #include "config.h" |
561 | |
562 | +#include <QQuickWindow> |
563 | +#include <QSGSimpleTextureNode> |
564 | + |
565 | #ifdef DEBUG_SHOW_TILE_BORDER |
566 | #include <QSGGeometryNode> |
567 | #include <QSGFlatColorMaterial> |
568 | #endif |
569 | |
570 | -//int SGTileItem::s_idCounter = 0xDEAD0000; |
571 | - |
572 | SGTileItem::SGTileItem(const QRect& area, qreal zoom, int id, QQuickItem *parent) |
573 | : QQuickItem(parent) |
574 | , m_area(area) |
575 | |
576 | === modified file 'src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.h' |
577 | --- src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.h 2015-10-05 06:42:33 +0000 |
578 | +++ src/plugin/libreofficetoolkit-qml-plugin/sgtileitem.h 2015-10-11 12:52:09 +0000 |
579 | @@ -2,11 +2,7 @@ |
580 | #define SGTILEITEM_H |
581 | |
582 | #include <QQuickItem> |
583 | -#include <QQuickWindow> |
584 | -#include <QSGSimpleTextureNode> |
585 | #include <QImage> |
586 | -#include <QtConcurrent/QtConcurrent> |
587 | -#include <QAtomicInteger> |
588 | |
589 | class LODocument; |
590 | |
591 | @@ -43,8 +39,6 @@ |
592 | qreal m_zoomFactor; |
593 | QImage m_data; |
594 | int m_id; |
595 | - |
596 | - // static int s_idCounter; |
597 | }; |
598 | |
599 | #endif // SGTILEITEM_H |