]> git.lyx.org Git - lyx.git/commitdiff
* Validator.{cpp, h}:
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 19 Jul 2009 16:53:50 +0000 (16:53 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 19 Jul 2009 16:53:50 +0000 (16:53 +0000)
- add usignedGlueLengthValidator

* GuiVSpace.cpp:
- re-allow the insertion of glue lengths (regression of the qt4 frontend)
  (bug 6097)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30692 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiVSpace.cpp
src/frontends/qt4/Validator.cpp
src/frontends/qt4/Validator.h

index 995393a9790dd9b42d8821057a5859078c11fb16..9df86fe318b880feddcace7466c2f86797e34fd1 100644 (file)
@@ -59,7 +59,7 @@ GuiVSpace::GuiVSpace(GuiView & lv)
        connect(unitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)),
                this, SLOT(change_adaptor()));
 
-       valueLE->setValidator(unsignedLengthValidator(valueLE));
+       valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
 
        // Manage the ok, apply, restore and cancel/close buttons
        bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
index 59655eb004485b2e3ebc5a833d09425aca538d6e..e156dcb099dedbe83a86326438d197cae0c494b3 100644 (file)
@@ -89,6 +89,14 @@ LengthValidator * unsignedLengthValidator(QLineEdit * ed)
 }
 
 
+LengthValidator * unsignedGlueLengthValidator(QLineEdit * ed)
+{
+       LengthValidator * v = new LengthValidator(ed);
+       v->setBottom(GlueLength());
+       return v;
+}
+
+
 LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const autotext)
        : LengthValidator(parent),
          autotext_(autotext)
index 81e46b0f571d175bc716272093775bfbff3a29e7..36250bbdca924721211af2eb446d1e4a39937803 100644 (file)
@@ -75,6 +75,13 @@ private:
 /// @returns a new @c LengthValidator that does not accept negative lengths.
 LengthValidator * unsignedLengthValidator(QLineEdit *);
 
+
+/** @returns a new @c LengthValidator that does not accept negative lengths.
+ *  but glue lengths.
+ */
+LengthValidator * unsignedGlueLengthValidator(QLineEdit *);
+
+
 /** A class to ascertain whether the data passed to the @c validate()
  *  member function can be interpretted as a GlueLength or is @param autotext.
  */