Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a45929c4 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Remove KoZoomMode::ZOOM_TEXT

This is no longer used in Krita, it was a hold-over from the
calligra/koffice days.
parent 80b23e0f
......@@ -193,9 +193,6 @@ void KoZoomAction::regenerateItems(const qreal zoom, bool asCurrent)
if(d->zoomModes & KoZoomMode::ZOOM_WIDTH) {
values << KoZoomMode::toString(KoZoomMode::ZOOM_WIDTH);
}
if(d->zoomModes & KoZoomMode::ZOOM_TEXT) {
values << KoZoomMode::toString(KoZoomMode::ZOOM_TEXT);
}
if(d->zoomModes & KoZoomMode::ZOOM_PAGE) {
values << KoZoomMode::toString(KoZoomMode::ZOOM_PAGE);
}
......
......@@ -97,18 +97,6 @@ QSizeF KoZoomController::pageSize() const
return d->pageSize;
}
void KoZoomController::setTextMinMax(qreal min, qreal max)
{
if(d->textMinX == min && d->textMaxX == max) {
return;
}
d->textMinX = min;
d->textMaxX = max;
if(d->zoomHandler->zoomMode() == KoZoomMode::ZOOM_TEXT)
setZoom(KoZoomMode::ZOOM_TEXT, 0);
}
void KoZoomController::setDocumentSize(const QSizeF &documentSize, bool recalculateCenter)
{
d->documentSize = documentSize;
......@@ -149,7 +137,6 @@ void KoZoomController::setZoom(KoZoomMode::Mode mode, qreal zoom, qreal resoluti
qreal oldEffectiveZoom = d->action->effectiveZoom();
QSize oldPageViewportSize = documentToViewport(d->pageSize);
QSize oldTextViewportSize = documentToViewport(QSizeF(d->textMaxX-d->textMinX, 1));
if(!qFuzzyCompare(d->zoomHandler->resolutionX(), resolutionX) ||
!qFuzzyCompare(d->zoomHandler->resolutionY(), resolutionY)) {
......@@ -176,12 +163,6 @@ void KoZoomController::setZoom(KoZoomMode::Mode mode, qreal zoom, qreal resoluti
d->action->setSelectedZoomMode(mode);
d->action->setEffectiveZoom(zoom);
}
else if (mode == KoZoomMode::ZOOM_TEXT) {
zoom = (d->canvasController->viewportSize().width() - 2 * d->fitMargin)
/ (oldTextViewportSize.width() / d->zoomHandler->zoom());
d->action->setSelectedZoomMode(mode);
d->action->setEffectiveZoom(zoom);
}
d->zoomHandler->setZoomMode(mode);
d->zoomHandler->setZoom(d->action->effectiveZoom());
......
......@@ -147,14 +147,6 @@ public Q_SLOTS:
*/
QSizeF pageSize() const;
/**
* Set the dimensions of where text can appear which allows zoom modes that use the text
* to update.
* @param min the minimum x value (in document coordinates) where text can appear
* @param max the maximum x value (in document coordinates) where text can appear
*/
void setTextMinMax(qreal min, qreal max);
/**
* Set the size of the whole document currently being shown on the canvas.
* The document size will be used together with the current zoom level to calculate the size of the
......
......@@ -52,8 +52,6 @@ public:
setZoom(KoZoomMode::ZOOM_WIDTH, -1);
if(zoomHandler->zoomMode() == KoZoomMode::ZOOM_PAGE)
setZoom(KoZoomMode::ZOOM_PAGE, -1);
if(zoomHandler->zoomMode() == KoZoomMode::ZOOM_TEXT)
setZoom(KoZoomMode::ZOOM_TEXT, -1);
}
/// when the canvas controller wants us to change zoom
......
......@@ -44,19 +44,16 @@ QString KoZoomMode::toString(Mode mode)
KoZoomMode::Mode KoZoomMode::toMode(const QString& mode)
{
if(mode == i18n(modes[ZOOM_WIDTH]))
if (mode == i18n(modes[ZOOM_WIDTH]))
return ZOOM_WIDTH;
else
if(mode == i18n(modes[ZOOM_PAGE]))
return ZOOM_PAGE;
else
if(mode == i18n(modes[ZOOM_PIXELS]))
return ZOOM_PIXELS;
else
if(mode == i18n(modes[ZOOM_TEXT]))
return ZOOM_TEXT;
else
return ZOOM_CONSTANT;
if (mode == i18n(modes[ZOOM_PAGE]))
return ZOOM_PAGE;
else
if (mode == i18n(modes[ZOOM_PIXELS]))
return ZOOM_PIXELS;
else
return ZOOM_CONSTANT;
// we return ZOOM_CONSTANT else because then we can pass '10%' or '15%'
// or whatever, it's automatically converted. ZOOM_CONSTANT is
// changeable, whereas all other zoom modes (non-constants) are normal
......
......@@ -36,8 +36,7 @@ public:
ZOOM_CONSTANT = 0, ///< zoom x %
ZOOM_WIDTH = 1, ///< zoom pagewidth
ZOOM_PAGE = 2, ///< zoom to pagesize
ZOOM_PIXELS = 4, ///< zoom to actual pixels
ZOOM_TEXT = 8 ///< zoom to actual pixels
ZOOM_PIXELS = 4 ///< zoom to actual pixels
};
Q_DECLARE_FLAGS(Modes, Mode)
......
......@@ -77,8 +77,6 @@ void zoomhandler_test::testApi()
zoomHandler.setZoomMode( KoZoomMode::ZOOM_CONSTANT );
QCOMPARE( zoomHandler.zoomMode(), KoZoomMode::ZOOM_CONSTANT );
zoomHandler.setZoomMode( KoZoomMode::ZOOM_WIDTH );
QCOMPARE( zoomHandler.zoomMode(), KoZoomMode::ZOOM_WIDTH );
zoomHandler.setZoomMode( KoZoomMode::ZOOM_PAGE );
QCOMPARE( zoomHandler.zoomMode(), KoZoomMode::ZOOM_PAGE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment