[LyX/master] GuiGraphic: delimit "Scale in LyX" (1--1000%)

Juergen Spitzmueller spitz at lyx.org
Sun Aug 7 13:57:06 UTC 2022


commit 14d63f5be86ef2463a70c792cdb0ff88c1374025
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Aug 7 16:40:12 2022 +0200

    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.
---
 src/frontends/qt/GuiGraphics.cpp  |    2 +-
 src/frontends/qt/ui/GraphicsUi.ui |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/GuiGraphics.cpp b/src/frontends/qt/GuiGraphics.cpp
index 64fa397..4ec478a 100644
--- a/src/frontends/qt/GuiGraphics.cpp
+++ b/src/frontends/qt/GuiGraphics.cpp
@@ -201,7 +201,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(buttonBox->button(QDialogButtonBox::Ok));
diff --git a/src/frontends/qt/ui/GraphicsUi.ui b/src/frontends/qt/ui/GraphicsUi.ui
index bd0f210..9d03e48 100644
--- a/src/frontends/qt/ui/GraphicsUi.ui
+++ b/src/frontends/qt/ui/GraphicsUi.ui
@@ -553,14 +553,14 @@
              </sizepolicy>
             </property>
             <property name="toolTip">
-             <string>Percentage to scale by in LyX</string>
+             <string>Percentage to scale by in LyX (1 to 1000)</string>
             </property>
            </widget>
           </item>
           <item row="0" column="0">
            <widget class="QLabel" name="scaleLA">
             <property name="toolTip">
-             <string>Percentage to scale by in LyX</string>
+             <string>Percentage to scale by in LyX (1 to 1000)</string>
             </property>
             <property name="text">
              <string>Sca&le on screen (%):</string>


More information about the lyx-cvs mailing list