From 0f34a81ee85c39c8b955079b64619a9278254971 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 26 Nov 2022 17:39:43 +0100 Subject: [PATCH] GuiGraphic: delimit "Scale in LyX" (1--1000%) Larger values will eventually crash LyX (see #12353), 0 or negative values make the image disappear in the workarea and impossible to edit. (cherry picked from parts of commit 14d63f5be86ef2463a70c792cdb0ff88c1374025) --- src/frontends/qt4/GuiGraphics.cpp | 2 +- status.23x | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiGraphics.cpp b/src/frontends/qt4/GuiGraphics.cpp index c32ec2c610..d5c139425b 100644 --- a/src/frontends/qt4/GuiGraphics.cpp +++ b/src/frontends/qt4/GuiGraphics.cpp @@ -209,7 +209,7 @@ GuiGraphics::GuiGraphics(GuiView & lv) connect(groupCO, SIGNAL(currentIndexChanged(int)), this, SLOT(changeGroup(int))); - displayscale->setValidator(new QIntValidator(displayscale)); + displayscale->setValidator(new QIntValidator(1, 1000, displayscale)); bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy); bc().setOK(okPB); diff --git a/status.23x b/status.23x index db4025448c..076bb4e67d 100644 --- a/status.23x +++ b/status.23x @@ -151,6 +151,8 @@ What's new - Limit zoom value to 1000% to avoid crashes (bug 12452). +- Limit graphics scaling in LyX to 1--1000% to avoid crashes (12353). + - Fix potential crash with 32bit ucs4 codepoints (bug 12519). - Catch warnings from packages that contain a hyphen in their name