]> git.lyx.org Git - features.git/commitdiff
Fix bug #6070: Width unit cannot be set in tabular dialog.
authorVincent van Ravesteijn <vfr@lyx.org>
Thu, 16 Jul 2009 07:47:02 +0000 (07:47 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Thu, 16 Jul 2009 07:47:02 +0000 (07:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30622 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiTabular.cpp

index f0dc2a69f9ecff4c99b6f8445b00a0c02ddc6308..25d5427685209530e292016148dc175876ff25df 100644 (file)
@@ -53,6 +53,8 @@ GuiTabular::GuiTabular(GuiView & lv)
        bottomspaceED->setValidator(new LengthValidator(bottomspaceED));
        interlinespaceED->setValidator(new LengthValidator(interlinespaceED));
 
+       widthUnitCB->setCurrentItem(Length::defaultUnit());
+
        connect(topspaceED, SIGNAL(returnPressed()),
                this, SLOT(topspace_changed()));
        connect(topspaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)),
@@ -770,10 +772,12 @@ void GuiTabular::updateContents()
        interlinespaceCO->setEnabled(!isReadonly);
 
        string colwidth;
-       if (!pwidth.zero())
+       if (!pwidth.zero()) {
                colwidth = pwidth.asString();
-       lengthToWidgets(widthED, widthUnitCB,
-               colwidth, default_unit);
+
+               lengthToWidgets(widthED, widthUnitCB,
+                       colwidth, default_unit);
+       }
 
        widthED->setEnabled(!isReadonly);
        widthUnitCB->setEnabled(!isReadonly);