Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/spreadsheet-part-selector into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Stefano Verzegnassi
Approved revision: 245
Merged at revision: 287
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/spreadsheet-part-selector
Merge into: lp:ubuntu-docviewer-app
Prerequisite: lp:~verzegnassi-stefano/ubuntu-docviewer-app/lok-qml-currentpart-moved
Diff against target: 415 lines (+162/-50)
7 files modified
po/com.ubuntu.docviewer.pot (+18/-7)
src/app/qml/loView/LOViewPage.qml (+39/-13)
src/app/qml/loView/SpreadsheetSelector.qml (+84/-0)
src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp (+8/-16)
src/plugin/libreofficetoolkit-qml-plugin/lodocument.h (+1/-6)
src/plugin/libreofficetoolkit-qml-plugin/loview.cpp (+2/-4)
src/plugin/libreofficetoolkit-qml-plugin/lozoom.cpp (+10/-4)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/spreadsheet-part-selector
Reviewer Review Type Date Requested Status
Jenkins Bot continuous-integration Approve
Nicholas Skaggs (community) Needs Fixing
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Review via email: mp+282845@code.launchpad.net

Commit message

LibreOffice viewer:
* Added a sheet selector
* Show an empty state when the current sheet has no content
* Fixed "currentPart" usage, partially broken after a recent commit in trunk

Description of the change

LibreOffice viewer:
* Added a sheet selector
* Show an empty state when the current sheet has no content
* Fixed "currentPart" usage, partially broken after a recent commit in trunk

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

This is excellent. Works really well.

review: Approve
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-autolanding/65/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1479/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

It seems that Jenkins has run a build on revision 239, but it didn't update the review. Top-approving...

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) :
review: Approve (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
Merging failed. More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-autolanding/809/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1511/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-autolanding/137/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1526/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-autolanding/144/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1535/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-autolanding/147/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-land-mp/1562/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Text conflict in po/com.ubuntu.docviewer.pot
1 conflicts encountered.

review: Needs Fixing
245. By Stefano Verzegnassi

Merged trunk + updated .pot

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot 2016-02-02 11:34:27 +0000
+++ po/com.ubuntu.docviewer.pot 2016-02-03 00:12:17 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2016-02-02 12:33+0100\n"11"POT-Creation-Date: 2016-02-03 00:58+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -216,7 +216,7 @@
216msgstr ""216msgstr ""
217217
218#: ../src/app/qml/documentPage/DocumentPage.qml:23218#: ../src/app/qml/documentPage/DocumentPage.qml:23
219#: /tmp/new-empty-state-build/po/com.ubuntu.docviewer.desktop.in.in.h:3219#: /tmp/spreadsheet-part-selector-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
220msgid "Documents"220msgid "Documents"
221msgstr ""221msgstr ""
222222
@@ -367,20 +367,24 @@
367msgid "GO!"367msgid "GO!"
368msgstr ""368msgstr ""
369369
370#: ../src/app/qml/loView/LOViewPage.qml:129370#: ../src/app/qml/loView/LOViewPage.qml:137
371msgid "LibreOffice binaries not found."371msgid "LibreOffice binaries not found."
372msgstr ""372msgstr ""
373373
374#: ../src/app/qml/loView/LOViewPage.qml:132374#: ../src/app/qml/loView/LOViewPage.qml:140
375msgid "Error while loading LibreOffice."375msgid "Error while loading LibreOffice."
376msgstr ""376msgstr ""
377377
378#: ../src/app/qml/loView/LOViewPage.qml:135378#: ../src/app/qml/loView/LOViewPage.qml:143
379msgid ""379msgid ""
380"Document not loaded.\n"380"Document not loaded.\n"
381"The requested document may be corrupt or protected by a password."381"The requested document may be corrupt or protected by a password."
382msgstr ""382msgstr ""
383383
384#: ../src/app/qml/loView/LOViewPage.qml:164
385msgid "This sheet has no content."
386msgstr ""
387
384#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by388#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
385#. Document Viewer for rendering LibreOffice/MS-Office documents.389#. Document Viewer for rendering LibreOffice/MS-Office documents.
386#. Ref. https://docs.libreoffice.org/libreofficekit.html390#. Ref. https://docs.libreoffice.org/libreofficekit.html
@@ -388,6 +392,13 @@
388msgid "Powered by LibreOfficeKit"392msgid "Powered by LibreOfficeKit"
389msgstr ""393msgstr ""
390394
395#. TRANSLATORS: Please don't add any space between "Sheet" and "%1".
396#. This is the default name for a sheet in LibreOffice.
397#: ../src/app/qml/loView/SpreadsheetSelector.qml:64
398#, qt-format
399msgid "Sheet%1"
400msgstr ""
401
391#: ../src/app/qml/loView/ZoomSelector.qml:122402#: ../src/app/qml/loView/ZoomSelector.qml:122
392msgid "Fit width"403msgid "Fit width"
393msgstr ""404msgstr ""
@@ -449,10 +460,10 @@
449msgid "copy %1"460msgid "copy %1"
450msgstr ""461msgstr ""
451462
452#: /tmp/new-empty-state-build/po/com.ubuntu.docviewer.desktop.in.in.h:1463#: /tmp/spreadsheet-part-selector-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
453msgid "Document Viewer"464msgid "Document Viewer"
454msgstr ""465msgstr ""
455466
456#: /tmp/new-empty-state-build/po/com.ubuntu.docviewer.desktop.in.in.h:2467#: /tmp/spreadsheet-part-selector-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
457msgid "documents;viewer;pdf;reader;"468msgid "documents;viewer;pdf;reader;"
458msgstr ""469msgstr ""
459470
=== modified file 'src/app/qml/loView/LOViewPage.qml'
--- src/app/qml/loView/LOViewPage.qml 2016-01-20 21:48:21 +0000
+++ src/app/qml/loView/LOViewPage.qml 2016-02-03 00:12:17 +0000
@@ -30,6 +30,7 @@
3030
31 property bool isPresentation: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.PresentationDocument)31 property bool isPresentation: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.PresentationDocument)
32 property bool isTextDocument: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.TextDocument)32 property bool isTextDocument: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.TextDocument)
33 property bool isSpreadsheet: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.SpreadsheetDocument)
3334
34 title: DocumentViewer.getFileBaseNameFromPath(file.path);35 title: DocumentViewer.getFileBaseNameFromPath(file.path);
35 flickable: isTextDocument ? loPage.contentItem.loView : null36 flickable: isTextDocument ? loPage.contentItem.loView : null
@@ -76,9 +77,16 @@
76 left: leftSidebar.right77 left: leftSidebar.right
77 right: parent.right78 right: parent.right
78 top: parent.top79 top: parent.top
79 bottom: parent.bottom80 bottom: sSelector.top
80 }81 }
81 }82 }
83
84 SpreadsheetSelector {
85 id: sSelector
86 anchors.bottom: parent.bottom
87 visible: loPage.isSpreadsheet
88 view: loView
89 }
82 }90 }
83 }91 }
84 ]92 ]
@@ -148,29 +156,47 @@
148156
149 Scrollbar { flickableItem: loView; parent: loView.parent }157 Scrollbar { flickableItem: loView; parent: loView.parent }
150 Scrollbar { flickableItem: loView; parent: loView.parent; align: Qt.AlignBottom }158 Scrollbar { flickableItem: loView; parent: loView.parent; align: Qt.AlignBottom }
159
160 Label {
161 anchors.centerIn: parent
162 parent: loPage
163 textSize: Label.Large
164 text: i18n.tr("This sheet has no content.")
165 visible: loPage.isSpreadsheet && loView.contentWidth <= 0 && loView.contentHeight <= 0
166 }
151 }167 }
152 }168 }
153169
154 PartsView {170 Item {
155 id: bottomBar171 id: bottomBar
156 anchors {172 anchors {
157 left: parent.left173 left: parent.left
158 right: parent.right174 right: parent.right
159 bottom: parent.bottom175 bottom: parent.bottom
160 }176 }
161 height: visible ? units.gu(12) : 0177 height: childrenRect.height
162 visible: loPage.isPresentation178
163179 PartsView {
164 model: loView.partsModel180 anchors { left: parent.left; right: parent.right }
165 orientation: ListView.Horizontal181 height: visible ? units.gu(12) : 0
166182 visible: loPage.isPresentation
167 HorizontalDivider {183
168 anchors {184 model: loView.partsModel
169 left: parent.left185 orientation: ListView.Horizontal
170 right: parent.right186
171 top: parent.top187 HorizontalDivider {
188 anchors {
189 left: parent.left
190 right: parent.right
191 top: parent.top
192 }
172 }193 }
173 }194 }
195
196 SpreadsheetSelector {
197 visible: loPage.isSpreadsheet
198 view: loView
199 }
174 }200 }
175 }201 }
176 }202 }
177203
=== added file 'src/app/qml/loView/SpreadsheetSelector.qml'
--- src/app/qml/loView/SpreadsheetSelector.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/loView/SpreadsheetSelector.qml 2016-02-03 00:12:17 +0000
@@ -0,0 +1,84 @@
1/*
2 * Copyright (C) 2016 Stefano Verzegnassi
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import DocumentViewer.LibreOffice 1.0
20
21import "../common"
22
23Item {
24 id: spreadsheetSelector
25 anchors { left: parent.left; right: parent.right }
26 height: visible ? units.gu(6) : 0
27
28 property Viewer view
29
30 Rectangle {
31 anchors.fill: parent
32 color: theme.palette.normal.background
33 }
34
35 ListView {
36 id: listView
37 anchors.fill: parent
38 boundsBehavior: Flickable.StopAtBounds
39 orientation: ListView.Horizontal
40
41 model: spreadsheetSelector.view.partsModel
42
43 delegate: AbstractButton {
44 id: del
45 property bool selected: spreadsheetSelector.view.currentPart == model.index
46
47 width: nameLabel.paintedWidth + units.gu(4)
48 height: parent.height
49
50 onClicked: spreadsheetSelector.view.currentPart = model.index
51
52 Rectangle {
53 anchors.fill: parent
54 visible: del.selected
55 color: theme.palette.selected.background
56 }
57
58 Label {
59 id: nameLabel
60 anchors.centerIn: parent
61
62 // TRANSLATORS: Please don't add any space between "Sheet" and "%1".
63 // This is the default name for a sheet in LibreOffice.
64 text: model.name || i18n.tr("Sheet%1").arg(model.index + 1)
65 color: del.selected ? UbuntuColors.orange : theme.palette.normal.baseText
66 }
67
68 Rectangle {
69 anchors {
70 left: parent.left
71 right: parent.right
72 bottom: parent.bottom
73 }
74 height: units.dp(2)
75 color: UbuntuColors.orange
76 visible: del.selected
77 }
78 }
79 }
80
81 HorizontalDivider {
82 anchors { left: parent.left; right: parent.right }
83 }
84}
085
=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp'
--- src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp 2015-12-14 00:40:55 +0000
+++ src/plugin/libreofficetoolkit-qml-plugin/lodocument.cpp 2016-02-03 00:12:17 +0000
@@ -127,25 +127,16 @@
127 return m_docType;127 return m_docType;
128}128}
129129
130int LODocument::documentPart() const
131{
132 return m_lokDocument->getPart();
133}
134
135void LODocument::setDocumentPart(int p)
136{
137 if (documentPart() != p)
138 m_lokDocument->setPart(p);
139}
140
141// Return the size of the document, in TWIPs130// Return the size of the document, in TWIPs
142QSize LODocument::documentSize() const131QSize LODocument::documentSize(int part) const
143{132{
144 if (!m_lokDocument)133 if (!m_lokDocument)
145 return QSize(0, 0);134 return QSize(0, 0);
146135
147 long pWidth(0);136 long pWidth(0);
148 long pHeight(0);137 long pHeight(0);
138
139 m_lokDocument->setPart(part);
149 m_lokDocument->getDocumentSize(&pWidth, &pHeight);140 m_lokDocument->getDocumentSize(&pWidth, &pHeight);
150141
151 return QSize(pWidth, pHeight);142 return QSize(pWidth, pHeight);
@@ -184,15 +175,16 @@
184 if (!m_lokDocument)175 if (!m_lokDocument)
185 return QImage();176 return QImage();
186177
187 m_lokDocument->setPart(part);
188
189#ifdef DEBUG_TILE_BENCHMARK178#ifdef DEBUG_TILE_BENCHMARK
190 QElapsedTimer renderTimer;179 QElapsedTimer renderTimer;
191 renderTimer.start();180 renderTimer.start();
192#endif181#endif
193182
194 qreal tWidth = this->documentSize().width();183 long tWidth(0);
195 qreal tHeight = this->documentSize().height();184 long tHeight(0);
185
186 m_lokDocument->setPart(part);
187 m_lokDocument->getDocumentSize(&tWidth, &tHeight);
196188
197 QSize resultSize;189 QSize resultSize;
198190
199191
=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/lodocument.h'
--- src/plugin/libreofficetoolkit-qml-plugin/lodocument.h 2015-12-14 00:40:55 +0000
+++ src/plugin/libreofficetoolkit-qml-plugin/lodocument.h 2016-02-03 00:12:17 +0000
@@ -35,7 +35,6 @@
35 Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)35 Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged)
36 // Declare partsCount as constant at the moment, since LOK-plugin is just a viewer for now.36 // Declare partsCount as constant at the moment, since LOK-plugin is just a viewer for now.
37 Q_PROPERTY(int partsCount READ partsCount CONSTANT)37 Q_PROPERTY(int partsCount READ partsCount CONSTANT)
38 Q_PROPERTY(int documentPart READ documentPart WRITE setDocumentPart NOTIFY documentPartChanged)
39 Q_PROPERTY(DocumentType documentType READ documentType NOTIFY documentTypeChanged)38 Q_PROPERTY(DocumentType documentType READ documentType NOTIFY documentTypeChanged)
40 Q_PROPERTY(LibreOfficeError::Error error READ error NOTIFY errorChanged)39 Q_PROPERTY(LibreOfficeError::Error error READ error NOTIFY errorChanged)
41 Q_ENUMS(DocumentType)40 Q_ENUMS(DocumentType)
@@ -57,10 +56,7 @@
5756
58 DocumentType documentType() const;57 DocumentType documentType() const;
5958
60 int documentPart() const;59 QSize documentSize(int part) const;
61 void setDocumentPart(int p);
62
63 QSize documentSize() const;
6460
65 QImage paintTile(int part, const QSize& canvasSize, const QRect& tileSize, const qreal& zoom = 1.0);61 QImage paintTile(int part, const QSize& canvasSize, const QRect& tileSize, const qreal& zoom = 1.0);
66 QImage paintThumbnail(int part, qreal size);62 QImage paintThumbnail(int part, qreal size);
@@ -74,7 +70,6 @@
74Q_SIGNALS:70Q_SIGNALS:
75 void pathChanged();71 void pathChanged();
76 void documentTypeChanged();72 void documentTypeChanged();
77 void documentPartChanged();
78 void errorChanged();73 void errorChanged();
7974
80private:75private:
8176
=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/loview.cpp'
--- src/plugin/libreofficetoolkit-qml-plugin/loview.cpp 2016-01-26 11:46:42 +0000
+++ src/plugin/libreofficetoolkit-qml-plugin/loview.cpp 2016-02-03 00:12:17 +0000
@@ -42,6 +42,7 @@
4242
43 connect(this, &LOView::documentChanged, this, &LOView::updateViewSize);43 connect(this, &LOView::documentChanged, this, &LOView::updateViewSize);
44 connect(this, &LOView::parentFlickableChanged, this, &LOView::updateVisibleRect);44 connect(this, &LOView::parentFlickableChanged, this, &LOView::updateVisibleRect);
45 connect(this, &LOView::currentPartChanged, this, &LOView::invalidateAllTiles);
45 connect(this, &LOView::cacheBufferChanged, this, &LOView::updateVisibleRect);46 connect(this, &LOView::cacheBufferChanged, this, &LOView::updateVisibleRect);
46 connect(&m_updateTimer, &QTimer::timeout, this, &LOView::updateVisibleRect);47 connect(&m_updateTimer, &QTimer::timeout, this, &LOView::updateVisibleRect);
4748
@@ -114,9 +115,6 @@
114 engine->addImageProvider("lok", m_imageProvider);115 engine->addImageProvider("lok", m_imageProvider);
115 // --------------------------------------------------116 // --------------------------------------------------
116117
117 setCurrentPart(0);
118 connect(this, SIGNAL(currentPartChanged()), this, SLOT(invalidateAllTiles()));
119
120 Q_EMIT documentChanged();118 Q_EMIT documentChanged();
121119
122 // Init zoom settings120 // Init zoom settings
@@ -203,7 +201,7 @@
203 if (!m_document)201 if (!m_document)
204 return;202 return;
205203
206 QSize docSize = m_document->documentSize();204 QSize docSize = m_document->documentSize(m_currentPart);
207 qreal zoomFactor = m_zoomSettings->zoomFactor();205 qreal zoomFactor = m_zoomSettings->zoomFactor();
208206
209 this->setWidth(Twips::convertTwipsToPixels(docSize.width(), zoomFactor));207 this->setWidth(Twips::convertTwipsToPixels(docSize.width(), zoomFactor));
210208
=== modified file 'src/plugin/libreofficetoolkit-qml-plugin/lozoom.cpp'
--- src/plugin/libreofficetoolkit-qml-plugin/lozoom.cpp 2016-01-21 14:24:02 +0000
+++ src/plugin/libreofficetoolkit-qml-plugin/lozoom.cpp 2016-02-03 00:12:17 +0000
@@ -161,8 +161,10 @@
161 if (changeMode)161 if (changeMode)
162 setZoomMode(LOZoom::FitToWidth);162 setZoomMode(LOZoom::FitToWidth);
163163
164 int currentPart = m_view->currentPart();
165
164 m_valueFitToWidthZoom = getZoomToFitWidth(m_view->parentFlickable()->width(),166 m_valueFitToWidthZoom = getZoomToFitWidth(m_view->parentFlickable()->width(),
165 m_view->document()->documentSize().width());167 m_view->document()->documentSize(currentPart).width());
166168
167 if (m_zoomFactor != m_valueFitToWidthZoom) {169 if (m_zoomFactor != m_valueFitToWidthZoom) {
168 setZoomFactor(m_valueFitToWidthZoom);170 setZoomFactor(m_valueFitToWidthZoom);
@@ -182,8 +184,10 @@
182 if (changeMode)184 if (changeMode)
183 setZoomMode(LOZoom::FitToHeight);185 setZoomMode(LOZoom::FitToHeight);
184186
187 int currentPart = m_view->currentPart();
188
185 m_valueFitToHeightZoom = getZoomToFitHeight(m_view->parentFlickable()->height(),189 m_valueFitToHeightZoom = getZoomToFitHeight(m_view->parentFlickable()->height(),
186 m_view->document()->documentSize().height());190 m_view->document()->documentSize(currentPart).height());
187191
188 if (m_zoomFactor != m_valueFitToHeightZoom) {192 if (m_zoomFactor != m_valueFitToHeightZoom) {
189 setZoomFactor(m_valueFitToHeightZoom);193 setZoomFactor(m_valueFitToHeightZoom);
@@ -203,11 +207,13 @@
203 if (changeMode)207 if (changeMode)
204 setZoomMode(LOZoom::Automatic);208 setZoomMode(LOZoom::Automatic);
205209
210 int currentPart = m_view->currentPart();
211
206 m_valueFitToWidthZoom = getZoomToFitWidth(m_view->parentFlickable()->width(),212 m_valueFitToWidthZoom = getZoomToFitWidth(m_view->parentFlickable()->width(),
207 m_view->document()->documentSize().width());213 m_view->document()->documentSize(currentPart).width());
208214
209 m_valueFitToHeightZoom = getZoomToFitHeight(m_view->parentFlickable()->height(),215 m_valueFitToHeightZoom = getZoomToFitHeight(m_view->parentFlickable()->height(),
210 m_view->document()->documentSize().height());216 m_view->document()->documentSize(currentPart).height());
211217
212 m_valueAutomaticZoom = qMin(m_valueFitToWidthZoom, m_valueFitToHeightZoom);218 m_valueAutomaticZoom = qMin(m_valueFitToWidthZoom, m_valueFitToHeightZoom);
213219

Subscribers

People subscribed via source and target branches