]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCompareHistory.cpp
Fix the tab ordering of GuiDocument components.
[lyx.git] / src / frontends / qt4 / GuiCompareHistory.cpp
index d33103244a883ea4be070dc8baa2f544746ea5ed..711cd51dcbaea2f21ec40dd70a909c03f32285ba 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <config.h>
+#include <support/debug.h>
 
 #include "GuiCompareHistory.h"
 
@@ -48,15 +49,18 @@ bool GuiCompareHistory::initialiseParams(std::string const &)
 {
        string revstring = lyxview().currentBufferView()->buffer().lyxvc().revisionInfo(LyXVC::File);
        int rev=0;
-       if (prefixIs(revstring, "r"))
-               revstring = ltrim(revstring,"r");
+
+       string tmp;
+       // RCS case
+       if (!isStrInt(revstring))
+               revstring = rsplit(revstring, tmp , '.' );
        if (isStrInt(revstring))
                rev = convert<int>(revstring);
 
        okPB->setEnabled(rev);
        rev1SB->setMaximum(rev);
        rev2SB->setMaximum(rev);
-       revbackSB->setMaximum(rev);
+       revbackSB->setMaximum(rev-1);
        rev2SB->setValue(rev);
        rev1SB->setValue(rev-1);
 
@@ -91,8 +95,11 @@ void GuiCompareHistory::selectBetweenrev()
 void GuiCompareHistory::enableControls()
 {
        bool rb = revbackRB->isChecked();
+       oldL->setEnabled(!rb);
+       newL->setEnabled(!rb);
        rev1SB->setEnabled(!rb);
        rev2SB->setEnabled(!rb);
+       rev2SB->setEnabled(!rb);
        betweenrevRB->setChecked(!rb);
        revbackSB->setEnabled(rb);
 }