]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormCitation.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / FormCitation.C
index f0dc375f0cebff224232923559623c1e08f5936d..87829f432463bf81d1e434581be05c73feafabaf 100644 (file)
 
 #include "lyx_forms.h"
 
-using lyx::support::getStringFromVector;
-using lyx::support::getVectorFromString;
-using lyx::support::trim;
-
 using std::find;
 using std::max;
 
@@ -36,6 +32,14 @@ using std::vector;
 using std::string;
 
 
+namespace lyx {
+
+using support::getStringFromVector;
+using support::getVectorFromString;
+using support::trim;
+
+namespace frontend {
+
 namespace {
 
 // shamelessly stolen from Menubar_pimpl.C
@@ -430,6 +434,10 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long)
                fl_set_choice(dialog_->choice_style, choice);
        }
 
+       // Invalid if no citation has been chosen
+       if (fl_get_browser_maxline(dialog_->browser_cite) < 1)
+               activate = ButtonPolicy::SMI_INVALID;
+
        return activate;
 }
 
@@ -522,3 +530,6 @@ void FormCitation::setCiteButtons(State status) const
        setEnabled(dialog_->button_up,   activate_up);
        setEnabled(dialog_->button_down, activate_down);
 }
+
+} // namespace frontend
+} // namespace lyx