diff --git a/src/frontends/xforms/Alert_pimpl.C b/src/frontends/xforms/Alert_pimpl.C index 58bc23dd31..d52a189511 100644 --- a/src/frontends/xforms/Alert_pimpl.C +++ b/src/frontends/xforms/Alert_pimpl.C @@ -57,7 +57,7 @@ pair const askForText_pimpl(string const & msg, string const & dfl fl_set_resource("flInput.clear.label", idex(_("Clear|#e"))); char const * tmp = fl_show_input(msg.c_str(), dflt.c_str()); if (tmp != 0) - return make_pair(true, string(tmp)); + return make_pair(true, string(tmp)); else - return make_pair(false, string()); + return make_pair(false, string()); } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 12b28e4460..c35a6f4d49 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2002-03-20 Angus Leeming + + * lots: whitespace changes. + 2002-03-20 Angus Leeming * FormParagraph.C: a little more factorisation. diff --git a/src/frontends/xforms/DropDown.C b/src/frontends/xforms/DropDown.C index 096e3436a9..49d412141b 100644 --- a/src/frontends/xforms/DropDown.C +++ b/src/frontends/xforms/DropDown.C @@ -89,9 +89,9 @@ void DropDown::line_up() if (fl_get_browser(browser_) > 1) fl_select_browser_line(browser_, fl_get_browser(browser_) - 1); if (fl_get_browser(browser_) >= fl_get_browser_topline(browser_) + - fl_get_browser_screenlines(browser_)) - fl_set_browser_topline(browser_, fl_get_browser(browser_) - - fl_get_browser_screenlines(browser_) + 1); + fl_get_browser_screenlines(browser_)) + fl_set_browser_topline(browser_, fl_get_browser(browser_) + - fl_get_browser_screenlines(browser_) + 1); if (fl_get_browser(browser_) < fl_get_browser_topline(browser_)) fl_set_browser_topline(browser_, fl_get_browser(browser_)); } @@ -102,9 +102,9 @@ void DropDown::line_down() if (fl_get_browser(browser_) < fl_get_browser_maxline(browser_)) fl_select_browser_line(browser_, fl_get_browser(browser_) + 1); if (fl_get_browser(browser_) >= fl_get_browser_topline(browser_) + - fl_get_browser_screenlines(browser_)) - fl_set_browser_topline(browser_, fl_get_browser(browser_) - - fl_get_browser_screenlines(browser_) + 1); + fl_get_browser_screenlines(browser_)) + fl_set_browser_topline(browser_, fl_get_browser(browser_) + - fl_get_browser_screenlines(browser_) + 1); if (fl_get_browser(browser_) < fl_get_browser_topline(browser_)) fl_set_browser_topline(browser_, fl_get_browser(browser_)); } @@ -119,7 +119,7 @@ int DropDown::peek(XEvent * xev) if (xev->type == ButtonPress) { if (!(x >= form_->x && x <= (form_->x + form_->w) && - y >= form_->y && y << (form_->y + form_->h))) { + y >= form_->y && y << (form_->y + form_->h))) { fl_hide_form(form_); return 1; } @@ -129,37 +129,37 @@ int DropDown::peek(XEvent * xev) KeySym keysym_return; XLookupString(&xev->xkey, s_r, 10, &keysym_return, 0); switch (keysym_return) { - case XK_Down: - line_down(); - return 1; - case XK_Up: - line_up(); - return 1; - case XK_Return: - completed(); - return 1; - case XK_Escape: - fl_deselect_browser(browser_); - completed(); - return 1; - default: - // FIXME: if someone has a got a way to - // convince the event to fall back to the - // minibuffer, I'm glad to hear it. - // fl_XPutBackEvent() doesn't work. + case XK_Down: + line_down(); + return 1; + case XK_Up: + line_up(); + return 1; + case XK_Return: + completed(); + return 1; + case XK_Escape: + fl_deselect_browser(browser_); + completed(); + return 1; + default: + // FIXME: if someone has a got a way to + // convince the event to fall back to the + // minibuffer, I'm glad to hear it. + // fl_XPutBackEvent() doesn't work. - // This is a bit less elegant perhaps, but works - // well enough. Angus 11 Jan 2002 - if (s_r[0] && isprint(s_r[0])) { - key_pressed(s_r[0]); - return 1; - } + // This is a bit less elegant perhaps, but works + // well enough. Angus 11 Jan 2002 + if (s_r[0] && isprint(s_r[0])) { + key_pressed(s_r[0]); + return 1; + } } } return 0; } - + void DropDown::completed() { XUngrabPointer(fl_get_display(), CurrentTime); diff --git a/src/frontends/xforms/FormAboutlyx.C b/src/frontends/xforms/FormAboutlyx.C index 49cb05628b..6f5a7577d7 100644 --- a/src/frontends/xforms/FormAboutlyx.C +++ b/src/frontends/xforms/FormAboutlyx.C @@ -59,17 +59,12 @@ void FormAboutlyx::build() // stack tabs fl_addto_tabfolder(dialog_->tabfolder,_("Copyright and Version"), - version_->form); + version_->form); fl_addto_tabfolder(dialog_->tabfolder,_("License and Warranty"), - license_->form); + license_->form); fl_addto_tabfolder(dialog_->tabfolder,_("Credits"), - credits_->form); + credits_->form); // Manage the cancel/close button bc().setCancel(dialog_->button_close); } - - - - - diff --git a/src/frontends/xforms/FormAboutlyx.h b/src/frontends/xforms/FormAboutlyx.h index 0f27e7e84b..f2474c88b0 100644 --- a/src/frontends/xforms/FormAboutlyx.h +++ b/src/frontends/xforms/FormAboutlyx.h @@ -60,4 +60,3 @@ private: }; #endif // FORMABOUTLYX_H - diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index 7ac2b85ff8..34144ebc20 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -97,9 +97,9 @@ void FormBase::show() fl_set_form_maxsize(form(), minw_, minh_); fl_show_form(form(), - FL_PLACE_MOUSE | FL_FREE_SIZE, - (controller_.IconifyWithMain() ? FL_TRANSIENT : 0), - title_.c_str()); + FL_PLACE_MOUSE | FL_FREE_SIZE, + (controller_.IconifyWithMain() ? FL_TRANSIENT : 0), + title_.c_str()); } tooltips().set(); diff --git a/src/frontends/xforms/FormBase.h b/src/frontends/xforms/FormBase.h index 29c27abd73..852d6248a4 100644 --- a/src/frontends/xforms/FormBase.h +++ b/src/frontends/xforms/FormBase.h @@ -39,7 +39,8 @@ public: virtual ~FormBase(); /** input callback function. invoked only by the xforms callback - interface */ + * interface + */ void InputCB(FL_OBJECT *, long); Tooltips & tooltips(); @@ -53,11 +54,11 @@ protected: void show(); /** Prepare the way to: - 1. display feedback as the mouse moves over ob. This feedback will - typically be rather more verbose than just a tooltip. - 2. activate the button controller after a paste with the middle - mouse button. - */ + * 1. display feedback as the mouse moves over ob. This feedback will + * typically be rather more verbose than just a tooltip. + * 2. activate the button controller after a paste with the middle + * mouse button. + */ static void setPrehandler(FL_OBJECT * ob); private: @@ -67,7 +68,8 @@ private: virtual ButtonPolicy::SMInput input(FL_OBJECT *, long); /** Redraw the form (on receipt of a Signal indicating, for example, - that the xform colors have been re-mapped). */ + * that the xform colors have been re-mapped). + */ virtual void redraw(); /// The dialog's minimum allowable dimensions. diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C index ad1d032602..8c92155574 100644 --- a/src/frontends/xforms/FormBaseDeprecated.C +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -117,9 +117,9 @@ void FormBaseDeprecated::show() fl_set_form_maxsize(form(), minw_, minh_); fl_show_form(form(), - FL_PLACE_MOUSE | FL_FREE_SIZE, - (lyxrc.dialogs_iconify_with_main ? FL_TRANSIENT : 0), - title_.c_str()); + FL_PLACE_MOUSE | FL_FREE_SIZE, + (lyxrc.dialogs_iconify_with_main ? FL_TRANSIENT : 0), + title_.c_str()); } tooltips().set(); @@ -221,9 +221,9 @@ FormBaseBD::FormBaseBD(LyXView * lv, Dialogs * d, string const & t, void FormBaseBD::connect() { u_ = d_->updateBufferDependent. - connect(slot(this, &FormBaseBD::updateSlot)); + connect(slot(this, &FormBaseBD::updateSlot)); h_ = d_->hideBufferDependent. - connect(slot(this, &FormBaseBD::hide)); + connect(slot(this, &FormBaseBD::hide)); FormBaseDeprecated::connect(); } diff --git a/src/frontends/xforms/FormBaseDeprecated.h b/src/frontends/xforms/FormBaseDeprecated.h index d274cca8ed..24e6ad8901 100644 --- a/src/frontends/xforms/FormBaseDeprecated.h +++ b/src/frontends/xforms/FormBaseDeprecated.h @@ -62,10 +62,10 @@ protected: // methods virtual xformsBC & bc() = 0; /** Redraw the form (on receipt of a Signal indicating, for example, - that the xform colors have been re-mapped). - Must be virtual because dialogs with tabbed folders will need to - redraw the form for each tab. - */ + * that the xform colors have been re-mapped). + * Must be virtual because dialogs with tabbed folders will need to + * redraw the form for each tab. + */ virtual void redraw(); /// Create the dialog if necessary, update it and display it. @@ -81,7 +81,7 @@ protected: // methods /// Build the dialog virtual void build() = 0; /** Filter the inputs on callback from xforms - Return true if inputs are valid. + * Return true if inputs are valid. */ virtual bool input( FL_OBJECT *, long) { return true; @@ -105,17 +105,17 @@ protected: // methods virtual FL_FORM * form() const = 0; /** Prepare the way to: - 1. display feedback as the mouse moves over ob. This feedback will - typically be rather more verbose than just a tooltip. - 2. activate the button controller after a paste with the middle - mouse button. - */ + * 1. display feedback as the mouse moves over ob. This feedback will + * typically be rather more verbose than just a tooltip. + * 2. activate the button controller after a paste with the middle + * mouse button. + */ static void setPrehandler(FL_OBJECT * ob); /** Which LyXFunc do we use? - We could modify Dialogs to have a visible LyXFunc* instead and - save a couple of bytes per dialog. - */ + * We could modify Dialogs to have a visible LyXFunc* instead and + * save a couple of bytes per dialog. + */ LyXView * lv_; /// Used so we can get at the signals we have to connect to. Dialogs * d_; @@ -139,8 +139,8 @@ private: /** This class is an XForms GUI base class for Buffer Independent dialogs. - Such dialogs do not require an update Connection although they may use - an update() function which is also supported by restore(). + * Such dialogs do not require an update Connection although they may use + * an update() function which is also supported by restore(). */ class FormBaseBI : public FormBaseDeprecated { protected: diff --git a/src/frontends/xforms/FormCharacter.C b/src/frontends/xforms/FormCharacter.C index 25e135c3e8..7158d36d7c 100644 --- a/src/frontends/xforms/FormCharacter.C +++ b/src/frontends/xforms/FormCharacter.C @@ -86,13 +86,13 @@ void FormCharacter::build() // insert default language box manually fl_addto_form(dialog_->form); - FL_OBJECT * ob = dialog_->choice_language; - fl_hide_object(dialog_->choice_language); + FL_OBJECT * ob = dialog_->choice_language; + fl_hide_object(dialog_->choice_language); - combo_language2_.reset(new Combox(FL_COMBOX_DROPLIST)); - combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250); - combo_language2_->shortcut("#L", 1); - combo_language2_->setcallback(ComboInputCB, this); + combo_language2_.reset(new Combox(FL_COMBOX_DROPLIST)); + combo_language2_->add(ob->x, ob->y, ob->w, ob->h, 250); + combo_language2_->shortcut("#L", 1); + combo_language2_->setcallback(ComboInputCB, this); fl_end_form(); // build up the combox entries @@ -137,6 +137,7 @@ void FormCharacter::apply() controller().setToggleAll(toggleall); } + namespace { template @@ -147,9 +148,10 @@ typename vector::size_type findPos(vector const & vec, A const & val) return 0; return it - vec.begin(); } - + } // namespace anon + void FormCharacter::update() { int pos = int(findPos(family_, controller().getFamily())); diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index 99bbcfa34b..d06beea7e9 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -103,8 +103,10 @@ void updateStyle(FD_form_citation * dialog, string command) } // namespace anon + typedef FormCB > base_class; + FormCitation::FormCitation(ControlCitation & c) : base_class(c, _("Citation"), false) {} @@ -238,8 +240,8 @@ void FormCitation::findBiblio(biblio::Direction const dir) vector::const_iterator const cit = - biblio::searchKeys(theMap, bibkeys, str, - start, type, dir, caseSensitive); + biblio::searchKeys(theMap, bibkeys, str, + start, type, dir, caseSensitive); if (cit == bibkeys.end()) return; @@ -278,7 +280,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long) string const tmp = formatted(biblio::getInfo(theMap, bibkeys[sel-1]), - dialog_->browser_info->w-10); + dialog_->browser_info->w-10); fl_add_browser_line(dialog_->browser_info, tmp.c_str()); // Highlight the selected browser_bib key in browser_cite if @@ -338,7 +340,7 @@ ButtonPolicy::SMInput FormCitation::input(FL_OBJECT * ob, long) // Add the selected browser_bib key to browser_cite fl_addto_browser(dialog_->browser_cite, - bibkeys[sel-1].c_str()); + bibkeys[sel-1].c_str()); citekeys.push_back(bibkeys[sel-1]); int const n = int(citekeys.size()); diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index 764521f306..4432d80a33 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -139,7 +139,7 @@ void FormDocument::build() vector units_vec = getLatexUnits(); #if 0 for (vector::iterator it = units_vec.begin(); - it != units_vec.end(); ++it) { + it != units_vec.end(); ++it) { if (contains(*it, "%")) it = units_vec.erase(it, it+1) - 1; } @@ -396,8 +396,8 @@ namespace { bool saveParamsAsDefault(BufferParams const ¶ms) { if (!Alert::askQuestion(_("Do you want to save the current settings"), - _("for the document layout as default?"), - _("(they will be valid for any new document)"))) + _("for the document layout as default?"), + _("(they will be valid for any new document)"))) return false; string const fname = AddName(AddPath(user_lyxdir, "templates/"), @@ -413,6 +413,7 @@ bool saveParamsAsDefault(BufferParams const ¶ms) } //namespace + bool FormDocument::input(FL_OBJECT * ob, long data) { State cb = static_cast(data); @@ -501,7 +502,7 @@ bool FormDocument::input(FL_OBJECT * ob, long data) if (ob == paper_->radio_landscape) fl_set_choice(paper_->choice_paperpackage, - BufferParams::PACKAGE_NONE + 1); + BufferParams::PACKAGE_NONE + 1); if (ob == paper_->choice_papersize) { int const paperchoice = fl_get_choice(paper_->choice_papersize); @@ -548,8 +549,8 @@ bool FormDocument::input(FL_OBJECT * ob, long data) || paperchoice == 2 || paperchoice > 5; int const default_unit = metric ? 8 : 9; if (strip(fl_get_input(paper_->input_custom_width)).empty()) - fl_set_choice(paper_->choice_custom_width_units, - default_unit); + fl_set_choice(paper_->choice_custom_width_units, + default_unit); if (strip(fl_get_input(paper_->input_custom_height)).empty()) fl_set_choice(paper_->choice_custom_height_units, default_unit); @@ -694,8 +695,8 @@ bool FormDocument::class_apply(BufferParams ¶ms) params.setDefSkip(VSpace(VSpace::MEDSKIP)); break; case 3: - params.setDefSkip(VSpace(VSpace::BIGSKIP)); - break; + params.setDefSkip(VSpace(VSpace::BIGSKIP)); + break; case 4: { string const length = @@ -778,14 +779,14 @@ bool FormDocument::class_apply() s += _(" paragraphs couldn't be converted"); } Alert::alert(_("Conversion Errors!"),s, - _("into chosen document class")); + _("into chosen document class")); } } else { // problem changing class -- warn user and retain old style Alert::alert(_("Conversion Errors!"), - _("Errors loading new document class."), - _("Reverting to original document class.")); + _("Errors loading new document class."), + _("Reverting to original document class.")); combo_doc_class->select(int(old_class) + 1); } } @@ -1014,8 +1015,8 @@ void FormDocument::class_update(BufferParams const & params) string const default_unit = metric ? "cm" : "in"; string const length = params.getDefSkip().asLyXCommand(); updateWidgetsFromLengthString(class_->input_doc_skip, - class_->choice_default_skip_units, - length, default_unit); + class_->choice_default_skip_units, + length, default_unit); break; } default: @@ -1142,11 +1143,11 @@ void FormDocument::paper_update(BufferParams const & params) // Default unit choice is cm if metric, inches if US paper. bool const metric = (paperchoice == 1 && lyxrc.default_papersize > 3) - || paperchoice == 2 || paperchoice > 5; + || paperchoice == 2 || paperchoice > 5; string const default_unit = metric ? "cm" : "in"; updateWidgetsFromLengthString(paper_->input_custom_width, - paper_->choice_custom_width_units, - params.paperwidth, default_unit); + paper_->choice_custom_width_units, + params.paperwidth, default_unit); setEnabled(paper_->input_custom_width, useCustom); setEnabled(paper_->choice_custom_width_units, useCustom); @@ -1269,15 +1270,15 @@ bool FormDocument::CheckDocumentInput(FL_OBJECT * ob, long) //display warning if input is not valid if (ob == class_->input_doc_skip - || ob == paper_->input_custom_width - || ob == paper_->input_custom_height - || ob == paper_->input_outer_margin - || ob == paper_->input_inner_margin - || ob == paper_->input_top_margin - || ob == paper_->input_bottom_margin - || ob == paper_->input_head_height - || ob == paper_->input_head_sep - || ob == paper_->input_foot_skip) { + || ob == paper_->input_custom_width + || ob == paper_->input_custom_height + || ob == paper_->input_outer_margin + || ob == paper_->input_inner_margin + || ob == paper_->input_top_margin + || ob == paper_->input_bottom_margin + || ob == paper_->input_head_height + || ob == paper_->input_head_sep + || ob == paper_->input_foot_skip) { if (!ok) { postWarning(_("Invalid Length (valid example: 10mm)")); return false; @@ -1461,8 +1462,8 @@ void FormDocument::CheckChoiceClass(FL_OBJECT * ob, long) } else { // unable to load new style Alert::alert(_("Conversion Errors!"), - _("Unable to switch to new document class."), - _("Reverting to original document class.")); + _("Unable to switch to new document class."), + _("Reverting to original document class.")); combo_doc_class->select(int(lv_->buffer()->params.textclass) + 1); } lv_->allowInput(); diff --git a/src/frontends/xforms/FormERT.C b/src/frontends/xforms/FormERT.C index 37e63c5d46..b9ee2f9a16 100644 --- a/src/frontends/xforms/FormERT.C +++ b/src/frontends/xforms/FormERT.C @@ -55,15 +55,15 @@ void FormERT::apply() void FormERT::update() { - switch (controller().params().status) { - case InsetERT::Open: + switch (controller().params().status) { + case InsetERT::Open: fl_set_button(dialog_->radio_open, 1); break; - case InsetERT::Collapsed: + case InsetERT::Collapsed: fl_set_button(dialog_->radio_collapsed, 1); break; - case InsetERT::Inlined: + case InsetERT::Inlined: fl_set_button(dialog_->radio_inlined, 1); break; - } + } } diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index 0c1271d476..9a58f76f5e 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -46,7 +46,7 @@ void FormExternal::build() dialog_.reset(build_external()); string const choice = - " " + getStringFromVector(controller().getTemplates(), " | ") + " "; + " " + getStringFromVector(controller().getTemplates(), " | ") + " "; fl_addto_choice(dialog_->choice_template, choice.c_str()); fl_set_input_return (dialog_->input_filename, FL_RETURN_CHANGED); diff --git a/src/frontends/xforms/FormInclude.C b/src/frontends/xforms/FormInclude.C index 144f54ce8e..fb951eac19 100644 --- a/src/frontends/xforms/FormInclude.C +++ b/src/frontends/xforms/FormInclude.C @@ -93,9 +93,9 @@ void FormInclude::apply() string const file = fl_get_input(dialog_->input_filename); if (controller().fileExists(file)) - controller().params().cparams.setContents(file); + controller().params().cparams.setContents(file); else - controller().params().cparams.setContents(""); + controller().params().cparams.setContents(""); if (fl_get_button(dialog_->radio_useinput)) controller().params().flag = InsetInclude::INPUT; diff --git a/src/frontends/xforms/FormInset.C b/src/frontends/xforms/FormInset.C index 917f163631..9113ed271f 100644 --- a/src/frontends/xforms/FormInset.C +++ b/src/frontends/xforms/FormInset.C @@ -29,9 +29,9 @@ FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t) void FormInset::connect() { u_ = d_->updateBufferDependent. - connect(slot(this, &FormInset::updateSlot)); + connect(slot(this, &FormInset::updateSlot)); h_ = d_->hideBufferDependent. - connect(slot(this, &FormInset::hide)); + connect(slot(this, &FormInset::hide)); FormBaseDeprecated::connect(); } diff --git a/src/frontends/xforms/FormMathsDeco.C b/src/frontends/xforms/FormMathsDeco.C index 461a15e160..640408c619 100644 --- a/src/frontends/xforms/FormMathsDeco.C +++ b/src/frontends/xforms/FormMathsDeco.C @@ -86,4 +86,3 @@ bool FormMathsDeco::input(FL_OBJECT * ob, long) apply(); return true; } - diff --git a/src/frontends/xforms/FormMathsDelim.C b/src/frontends/xforms/FormMathsDelim.C index f20c3e934e..832c51d08d 100644 --- a/src/frontends/xforms/FormMathsDelim.C +++ b/src/frontends/xforms/FormMathsDelim.C @@ -99,8 +99,8 @@ bool FormMathsDelim::input(FL_OBJECT *, long) int const i = fl_get_bmtable(dialog_->bmtable); int const button = fl_get_bmtable_numb(dialog_->bmtable); - bool const both = (button == FL_MIDDLE_MOUSE) - || (fl_get_button(dialog_->radio_both) != 0); + bool const both = (button == FL_MIDDLE_MOUSE || + fl_get_button(dialog_->radio_both) != 0); if (i >= 0) { if (side || (button == FL_RIGHT_MOUSE)) diff --git a/src/frontends/xforms/FormMathsMatrix.C b/src/frontends/xforms/FormMathsMatrix.C index 8be7fd890e..11fb88c87e 100644 --- a/src/frontends/xforms/FormMathsMatrix.C +++ b/src/frontends/xforms/FormMathsMatrix.C @@ -52,7 +52,7 @@ extern "C" { FormMathsMatrix::FormMathsMatrix(LyXView * lv, Dialogs * d, - FormMathsPanel const & p) + FormMathsPanel const & p) : FormMathsSub(lv, d, p, _("Maths Matrix"), false) {} diff --git a/src/frontends/xforms/FormMathsPanel.C b/src/frontends/xforms/FormMathsPanel.C index 07b251ad02..fcab83b7bd 100644 --- a/src/frontends/xforms/FormMathsPanel.C +++ b/src/frontends/xforms/FormMathsPanel.C @@ -404,7 +404,7 @@ void FormMathsPanel::mathDisplay() const FormMathsSub::FormMathsSub(LyXView * lv, Dialogs * d, FormMathsPanel const & p, string const & t, bool allowResize) - : FormBaseBD(lv, d, t, allowResize), parent_(p), bc_("Close") + : FormBaseBD(lv, d, t, allowResize), parent_(p), bc_("Close") {} @@ -420,5 +420,3 @@ void FormMathsSub::disconnect() parent_.setActive(0); FormBaseBD::disconnect(); } - - diff --git a/src/frontends/xforms/FormMathsSpace.C b/src/frontends/xforms/FormMathsSpace.C index 19dc369be3..11402a6a14 100644 --- a/src/frontends/xforms/FormMathsSpace.C +++ b/src/frontends/xforms/FormMathsSpace.C @@ -64,7 +64,7 @@ bool FormMathsSpace::input(FL_OBJECT *, long data) if (data >= 0 && data < 6) { space_ = short(data); - apply(); + apply(); } return true; } diff --git a/src/frontends/xforms/FormMathsStyle.C b/src/frontends/xforms/FormMathsStyle.C index 4a9e1e5012..86db7273c9 100644 --- a/src/frontends/xforms/FormMathsStyle.C +++ b/src/frontends/xforms/FormMathsStyle.C @@ -56,38 +56,38 @@ void FormMathsStyle::build() dialog_.reset(build_maths_style()); fl_set_bmtable_data(dialog_->bmtable_style1, 1, 1, - style1_width, style1_height, style1_bits); + style1_width, style1_height, style1_bits); fl_set_bmtable_maxitems(dialog_->bmtable_style1, 1); bc().addReadOnly(dialog_->bmtable_style1); fl_set_bmtable_data(dialog_->bmtable_style2, 1, 3, - style2_width, style2_height, style2_bits); + style2_width, style2_height, style2_bits); fl_set_bmtable_maxitems(dialog_->bmtable_style2, 3); bc().addReadOnly(dialog_->bmtable_style2); fl_set_bmtable_data(dialog_->bmtable_font1, 1, 5, - font1_width, font1_height, font1_bits); + font1_width, font1_height, font1_bits); fl_set_bmtable_maxitems(dialog_->bmtable_font1, 5); bc().addReadOnly(dialog_->bmtable_font1); fl_set_bmtable_data(dialog_->bmtable_font2, 1, 3, - font2_width, font2_height, font2_bits); + font2_width, font2_height, font2_bits); fl_set_bmtable_maxitems(dialog_->bmtable_font2, 3); bc().addReadOnly(dialog_->bmtable_font2); bc().setCancel(dialog_->button_close); - } +} void FormMathsStyle::apply() { if ((style_ >= 0) && (style_ < 4)) parent_.insertSymbol(latex_mathstyle[style_]); - else - if ((style_ >= 4) && (style_ < 14)) + else if ((style_ >= 4) && (style_ < 14)) parent_.dispatchFunc(latex_mathfontcmds[style_ - 4]); } + bool FormMathsStyle::input(FL_OBJECT * ob, long data) { style_ = fl_get_bmtable(ob); diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 821943c1c1..b1432e15e4 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -1111,7 +1111,7 @@ bool FormPreferences::Converters::Input() } else { fl_set_object_label(dialog_->button_add, idex(_("Modify|#M"))); fl_set_button_shortcut(dialog_->button_add, - scex(_("Modify|#M")), 1); + scex(_("Modify|#M")), 1); int top = max(sel-5, 0); fl_set_browser_topline(dialog_->browser_all, top); @@ -1374,18 +1374,18 @@ bool FormPreferences::Formats::Input() if (sel < 0) { fl_set_object_label(dialog_->button_add, - idex(_("Add|#A"))); + idex(_("Add|#A"))); fl_set_button_shortcut(dialog_->button_add, - scex(_("Add|#A")), 1); + scex(_("Add|#A")), 1); fl_deselect_browser(dialog_->browser_all); setEnabled(dialog_->button_delete, false); } else { fl_set_object_label(dialog_->button_add, - idex(_("Modify|#M"))); + idex(_("Modify|#M"))); fl_set_button_shortcut(dialog_->button_add, - scex(_("Modify|#M")), 1); + scex(_("Modify|#M")), 1); int const top = max(sel-5, 0); fl_set_browser_topline(dialog_->browser_all, top); @@ -1645,7 +1645,7 @@ void FormPreferences::Language::build() combo_default_lang->setcallback(ComboCB, &parent_); for (Languages::const_iterator cit = languages.begin(); - cit != languages.end(); ++cit) { + cit != languages.end(); ++cit) { combo_default_lang->addto(cit->second.lang()); } @@ -1792,10 +1792,10 @@ void FormPreferences::Language::update() void FormPreferences::Language::ComboCB(int, void * v, Combox * combox) { - FormPreferences * pre = static_cast(v); - // This is safe, as nothing is done to the pointer, other than - // to use its address in a block-if statement. - pre->bc().valid(pre->input(reinterpret_cast(combox), 0)); + FormPreferences * pre = static_cast(v); + // This is safe, as nothing is done to the pointer, other than + // to use its address in a block-if statement. + pre->bc().valid(pre->input(reinterpret_cast(combox), 0)); } @@ -2025,7 +2025,7 @@ void FormPreferences::OutputsMisc::update() fl_set_input(dialog_->input_paperoption, lyxrc.view_dvi_paper_option.c_str()); fl_set_button(dialog_->check_autoreset_classopt, - lyxrc.auto_reset_options); + lyxrc.auto_reset_options); } @@ -2690,8 +2690,8 @@ bool FormPreferences::ScreenFonts::input() activate = false; str = N_("Fonts must be positive!"); - // Fontsizes -- tiny < script < footnote etc. } else if (strToDbl(fl_get_input(dialog_->input_tiny)) > + // Fontsizes -- tiny < script < footnote etc. strToDbl(fl_get_input(dialog_->input_script)) || strToDbl(fl_get_input(dialog_->input_script)) > strToDbl(fl_get_input(dialog_->input_footnote)) || @@ -2838,11 +2838,7 @@ void FormPreferences::SpellOptions::build() dialog_.reset(parent_.build_spelloptions()); fl_addto_choice(dialog_->choice_spell_command, -#if 0 - _(" none | ispell | aspell ")); -#else _(" ispell | aspell ")); -#endif fl_set_input_return(dialog_->input_alt_lang, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_escape_chars, FL_RETURN_CHANGED); fl_set_input_return(dialog_->input_personal_dict, FL_RETURN_CHANGED); diff --git a/src/frontends/xforms/FormPreferences.h b/src/frontends/xforms/FormPreferences.h index e7f03bfcc7..cee9831599 100644 --- a/src/frontends/xforms/FormPreferences.h +++ b/src/frontends/xforms/FormPreferences.h @@ -77,9 +77,9 @@ private: string const getFeedback(FL_OBJECT *); /// void browse(FL_OBJECT * input, - string const & title, string const & pattern, - std::pair const & dir1= std::make_pair(string(),string()), - std::pair const & dir2 = std::make_pair(string(),string())); + string const & title, string const & pattern, + std::pair const & dir1= std::make_pair(string(),string()), + std::pair const & dir2 = std::make_pair(string(),string())); /// Fdesign generated methods FD_form_preferences * build_preferences(); diff --git a/src/frontends/xforms/FormPrint.C b/src/frontends/xforms/FormPrint.C index 6bc391a5d3..54f38c2fff 100644 --- a/src/frontends/xforms/FormPrint.C +++ b/src/frontends/xforms/FormPrint.C @@ -234,7 +234,7 @@ ButtonPolicy::SMInput FormPrint::input(FL_OBJECT * ob, long) // if we type into file, select that as a target if (ob == dialog_->input_file && fl_get_button(dialog_->radio_printer) - && strlen(fl_get_input(dialog_->input_file))) { + && strlen(fl_get_input(dialog_->input_file))) { fl_set_button(dialog_->radio_file, 1); fl_set_button(dialog_->radio_printer, 0); } else if (ob == dialog_->input_printer) { diff --git a/src/frontends/xforms/FormSpellchecker.C b/src/frontends/xforms/FormSpellchecker.C index 4f69e7298c..6dadfd2ff7 100644 --- a/src/frontends/xforms/FormSpellchecker.C +++ b/src/frontends/xforms/FormSpellchecker.C @@ -127,7 +127,7 @@ void FormSpellchecker::partialUpdate(int id) fl_add_browser_line(dialog_->browser, w.c_str()); } } - break; + break; case 2: // show exit message fl_show_messages(controller().getMessage().c_str()); diff --git a/src/frontends/xforms/FormTabular.C b/src/frontends/xforms/FormTabular.C index 7ff5036ba0..1339b8811c 100644 --- a/src/frontends/xforms/FormTabular.C +++ b/src/frontends/xforms/FormTabular.C @@ -152,8 +152,7 @@ void FormTabular::build() vector units_vec = getLatexUnits(); #if 0 for (vector::iterator it = units_vec.begin(); - it != units_vec.end(); ++it) - { + it != units_vec.end(); ++it) { if (contains(*it, "%")) it = units_vec.erase(it, it + 1) - 1; } @@ -214,20 +213,18 @@ void FormTabular::update() // to set if we are in first/last cell of row or if the left/right // cell is also a multicolumn. if (tabular->IsFirstCellInRow(cell) || - tabular->IsMultiColumn(cell-1)) - { + tabular->IsMultiColumn(cell-1)) { fl_set_button(cell_options_->check_border_left, - tabular->LeftLine(cell)?1:0); + tabular->LeftLine(cell)?1:0); setEnabled(cell_options_->check_border_left, true); } else { fl_set_button(cell_options_->check_border_left, 0); setEnabled(cell_options_->check_border_left, false); } if (tabular->IsLastCellInRow(cell) || - tabular->IsMultiColumn(cell+1)) - { + tabular->IsMultiColumn(cell+1)) { fl_set_button(cell_options_->check_border_right, - tabular->RightLine(cell)?1:0); + tabular->RightLine(cell)?1:0); setEnabled(cell_options_->check_border_right, true); } else { fl_set_button(cell_options_->check_border_right, 0); @@ -527,7 +524,7 @@ bool FormTabular::input(FL_OBJECT * ob, long) LyXTabular * tabular = inset_->tabular.get(); string str1 = getLengthFromWidgets(column_options_->input_column_width, - column_options_->choice_value_column_width); + column_options_->choice_value_column_width); string str2; LyXLength llen = tabular->GetColumnPWidth(cell); if (!llen.zero()) @@ -564,35 +561,33 @@ bool FormTabular::input(FL_OBJECT * ob, long) // No point in processing directives that you can't do anything with // anyhow, so exit now if the buffer is read-only. if (lv_->buffer()->isReadonly()) { - update(); - return false; - } - if ((ob == column_options_->input_column_width) || - (ob == column_options_->choice_value_column_width)) - { - string const str = - getLengthFromWidgets(column_options_->input_column_width, - column_options_->choice_value_column_width); - inset_->tabularFeatures(lv_->view(), LyXTabular::SET_PWIDTH, str); - - //check if the input is valid - string const input = - fl_get_input(column_options_->input_column_width); - if (!input.empty() && !isValidLength(input) && !isStrDbl(input)) { - postWarning(_("Invalid Length (valid example: 10mm)")); + update(); return false; } + if ((ob == column_options_->input_column_width) || + (ob == column_options_->choice_value_column_width)) { + string const str = + getLengthFromWidgets(column_options_->input_column_width, + column_options_->choice_value_column_width); + inset_->tabularFeatures(lv_->view(), LyXTabular::SET_PWIDTH, str); - update(); // update for alignment - return true; + //check if the input is valid + string const input = + fl_get_input(column_options_->input_column_width); + if (!input.empty() && !isValidLength(input) && !isStrDbl(input)) { + postWarning(_("Invalid Length (valid example: 10mm)")); + return false; + } + + update(); // update for alignment + return true; } if ((ob == cell_options_->input_mcolumn_width) || - (ob == cell_options_->choice_value_mcolumn_width)) - { + (ob == cell_options_->choice_value_mcolumn_width)) { string const str = getLengthFromWidgets(cell_options_->input_mcolumn_width, - cell_options_->choice_value_mcolumn_width); + cell_options_->choice_value_mcolumn_width); inset_->tabularFeatures(lv_->view(), LyXTabular::SET_MPWIDTH, str); //check if the input is valid @@ -642,7 +637,7 @@ bool FormTabular::input(FL_OBJECT * ob, long) num = LyXTabular::MULTICOLUMN; else if (ob == tabular_options_->check_longtable) { if (fl_get_button(tabular_options_->check_longtable)) - num = LyXTabular::SET_LONGTABULAR; + num = LyXTabular::SET_LONGTABULAR; else num = LyXTabular::UNSET_LONGTABULAR; } else if (ob == tabular_options_->check_rotate_tabular) { @@ -673,8 +668,7 @@ bool FormTabular::input(FL_OBJECT * ob, long) (ob == longtable_options_->check_lt_lastfoot) || (ob == longtable_options_->check_lastfoot_2border_above) || (ob == longtable_options_->check_lastfoot_2border_below) || - (ob == longtable_options_->check_lastfoot_empty)) - { + (ob == longtable_options_->check_lastfoot_empty)) { num = static_cast(checkLongtableOptions(ob, special)); } else if (ob == longtable_options_->check_lt_newpage) { num = LyXTabular::SET_LTNEWPAGE; @@ -719,18 +713,15 @@ int FormTabular::checkLongtableOptions(FL_OBJECT * ob, string & special) if ((ob == longtable_options_->check_1head_2border_above) || (ob == longtable_options_->check_head_2border_above) || (ob == longtable_options_->check_foot_2border_above) || - (ob == longtable_options_->check_lastfoot_2border_above)) - { + (ob == longtable_options_->check_lastfoot_2border_above)) { special = "dl_above"; } else if ((ob == longtable_options_->check_1head_2border_below) || - (ob == longtable_options_->check_head_2border_below) || - (ob == longtable_options_->check_foot_2border_below) || - (ob == longtable_options_->check_lastfoot_2border_below)) - { + (ob == longtable_options_->check_head_2border_below) || + (ob == longtable_options_->check_foot_2border_below) || + (ob == longtable_options_->check_lastfoot_2border_below)) { special = "dl_below"; } else if ((ob == longtable_options_->check_1head_empty) || - (ob == longtable_options_->check_lastfoot_empty)) - { + (ob == longtable_options_->check_lastfoot_empty)) { special = "empty"; } else { special = ""; @@ -738,27 +729,24 @@ int FormTabular::checkLongtableOptions(FL_OBJECT * ob, string & special) if ((ob == longtable_options_->check_lt_firsthead) || (ob == longtable_options_->check_1head_2border_above) || (ob == longtable_options_->check_1head_2border_below) || - (ob == longtable_options_->check_1head_empty)) - { + (ob == longtable_options_->check_1head_empty)) { return (flag ? LyXTabular::SET_LTFIRSTHEAD : - LyXTabular::UNSET_LTFIRSTHEAD); + LyXTabular::UNSET_LTFIRSTHEAD); } else if ((ob == longtable_options_->check_lt_head) || - (ob == longtable_options_->check_head_2border_above) || - (ob == longtable_options_->check_head_2border_below)) - { + (ob == longtable_options_->check_head_2border_above) || + (ob == longtable_options_->check_head_2border_below)) { return (flag ? LyXTabular::SET_LTHEAD : LyXTabular::UNSET_LTHEAD); } else if ((ob == longtable_options_->check_lt_foot) || - (ob == longtable_options_->check_foot_2border_above) || - (ob == longtable_options_->check_foot_2border_below)) - { + (ob == longtable_options_->check_foot_2border_above) || + (ob == longtable_options_->check_foot_2border_below)) { return (flag ? LyXTabular::SET_LTFOOT : LyXTabular::UNSET_LTFOOT); } else if ((ob == longtable_options_->check_lt_lastfoot) || - (ob == longtable_options_->check_lastfoot_2border_above) || - (ob == longtable_options_->check_lastfoot_2border_below) || - (ob == longtable_options_->check_lastfoot_empty)) - { + (ob == longtable_options_->check_lastfoot_2border_above) || + (ob == longtable_options_->check_lastfoot_2border_below) || + (ob == longtable_options_->check_lastfoot_empty)) { return (flag ? LyXTabular::SET_LTLASTFOOT : - LyXTabular::UNSET_LTLASTFOOT); + LyXTabular::UNSET_LTLASTFOOT); } + return LyXTabular::LAST_ACTION; } diff --git a/src/frontends/xforms/FormTabularCreate.C b/src/frontends/xforms/FormTabularCreate.C index 9875d7db82..47fcb36935 100644 --- a/src/frontends/xforms/FormTabularCreate.C +++ b/src/frontends/xforms/FormTabularCreate.C @@ -3,7 +3,7 @@ * Copyright 2000-2001 The LyX Team. * See the file COPYING. * - * \author \author Jürgen Vigna, jug@sad.it + * \author Jürgen Vigna, jug@sad.it */ #include diff --git a/src/frontends/xforms/FormTabularCreate.h b/src/frontends/xforms/FormTabularCreate.h index 254e047a1c..a16ed11fc2 100644 --- a/src/frontends/xforms/FormTabularCreate.h +++ b/src/frontends/xforms/FormTabularCreate.h @@ -5,7 +5,7 @@ * Copyright 1995-2001 the LyX Team * Read the file COPYING * - * \author unknown. + * \author Jürgen Vigna, jug@sad.it */ #ifndef FORMTABULARCREATE_H diff --git a/src/frontends/xforms/MathsSymbols.C b/src/frontends/xforms/MathsSymbols.C index 623d1c3cfc..e93cefa439 100644 --- a/src/frontends/xforms/MathsSymbols.C +++ b/src/frontends/xforms/MathsSymbols.C @@ -70,8 +70,7 @@ char const * function_names[] = { "tan", "tanh" }; -int const nr_function_names = sizeof(function_names) / - sizeof(char const *); +int const nr_function_names = sizeof(function_names) / sizeof(char const *); char const * latex_arrow[] = { "downarrow", "leftarrow", "Downarrow", "Leftarrow", @@ -239,17 +238,17 @@ int const nr_latex_ams_ops = sizeof(latex_ams_ops) / sizeof(char const *); static char const ** mathed_get_pixmap_from_icon(int d) { switch (d) { - case MM_FRAC: return frac; - case MM_SQRT: return sqrt_xpm; - case MM_SUPER: return super_xpm; - case MM_SUB: return sub_xpm; - case MM_STYLE: return style_xpm; - case MM_DELIM: return delim; - case MM_MATRIX: return matrix; - case MM_EQU: return equation; - case MM_DECO: return deco; - case MM_SPACE: return space_xpm; - default: return 0; + case MM_FRAC: return frac; + case MM_SQRT: return sqrt_xpm; + case MM_SUPER: return super_xpm; + case MM_SUB: return sub_xpm; + case MM_STYLE: return style_xpm; + case MM_DELIM: return delim; + case MM_MATRIX: return matrix; + case MM_EQU: return equation; + case MM_DECO: return deco; + case MM_SPACE: return space_xpm; + default: return 0; } } @@ -274,7 +273,7 @@ static char const ** pixmapFromBitmapData(char const * s, int wx, int hx) case 8: latex_str = latex_ams_rel; break; case 9: latex_str = latex_ams_nrel; break; case 10: latex_str = latex_ams_ops; break; - // Add AMS stuff here -- MV + // Add AMS stuff here -- MV } for (int k = 0; latex_str[k][0] > ' '; ++k) { diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index ca4d75ab94..6e9ad42a6c 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -87,7 +87,7 @@ Menubar::Pimpl::Pimpl(LyXView * view, MenuBackend const & mb) : owner_(view), menubackend_(&mb), current_group_(0) { for (MenuBackend::const_iterator menu = menubackend_->begin(); - menu != menubackend_->end() ; ++menu) { + menu != menubackend_->end() ; ++menu) { if (menu->menubar()) { FL_OBJECT * group = fl_bgn_group(); makeMenubar(*menu); @@ -328,6 +328,7 @@ void add_toc2(int menu, string const & extra_label, } // namespace anon + void Menubar::Pimpl::add_toc(int menu, string const & extra_label, vector & smn, Window win) { diff --git a/src/frontends/xforms/RadioButtonGroup.C b/src/frontends/xforms/RadioButtonGroup.C index e2a0df2cff..c6a7e71530 100644 --- a/src/frontends/xforms/RadioButtonGroup.C +++ b/src/frontends/xforms/RadioButtonGroup.C @@ -56,8 +56,8 @@ struct equal_to_second_in_pair typedef typename T::second_type second_argument_type; bool operator() ( - pair < typename T::first_type, typename T::second_type > const & left, - typename T::second_type const & right) const + pair < typename T::first_type, typename T::second_type > const & left, + typename T::second_type const & right) const { return left.second == right; } @@ -69,9 +69,9 @@ void RadioButtonGroup::setButton(int value) { #if 0 ButtonValueMap::const_iterator it = - find_if(map.begin(), map.end(), - bind2nd(equal_to_second_in_pair(), - value)); + find_if(map.begin(), map.end(), + bind2nd(equal_to_second_in_pair(), + value)); #else ButtonValueMap::const_iterator it = find_if(map.begin(), map.end(), @@ -81,7 +81,7 @@ void RadioButtonGroup::setButton(int value) // If we found nothing, report it and return if (it == map.end()) { lyxerr << "BUG: Requested value in RadioButtonGroup doesn't exists" - << endl; + << endl; } else { fl_set_button(it->first, 1); @@ -103,8 +103,8 @@ int RadioButtonGroup::getButton() { // Find the first button that is active ButtonValueMap::iterator it = - find_if(map.begin(), map.end(), - is_set_button ()); + find_if(map.begin(), map.end(), + is_set_button ()); // If such a button was found, return its value. if (it != map.end()) { diff --git a/src/frontends/xforms/Timeout_pimpl.C b/src/frontends/xforms/Timeout_pimpl.C index 3c45d6d1ac..6ea6bb3331 100644 --- a/src/frontends/xforms/Timeout_pimpl.C +++ b/src/frontends/xforms/Timeout_pimpl.C @@ -24,12 +24,12 @@ namespace { extern "C" { - static - void C_intern_timeout_cb(int, void * data) - { - Timeout * to = static_cast(data); - to->emit(); - } +static +void C_intern_timeout_cb(int, void * data) +{ + Timeout * to = static_cast(data); + to->emit(); +} } diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index abb446e3a2..fe790b609f 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -275,15 +275,15 @@ void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) if (!fullname.empty()) { lyxerr[Debug::GUI] << "Full icon name is `" - << fullname << "'" << endl; + << fullname << "'" << endl; fl_set_pixmapbutton_file(obj, fullname.c_str()); return; } if (act == LFUN_INSERT_MATH && !arg.empty()) { char const ** pixmap = get_pixmap_from_symbol(arg.c_str(), - buttonwidth, - height); + buttonwidth, + height); if (pixmap) { lyxerr[Debug::GUI] << "Using mathed-provided icon" << endl; @@ -297,7 +297,7 @@ void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height) fullname = LibFileSearch("images", "unknown", "xpm"); if (!fullname.empty()) { lyxerr[Debug::GUI] << "Using default `unknown' icon" - << endl; + << endl; fl_set_pixmapbutton_file(obj, fullname.c_str()); } } @@ -453,7 +453,7 @@ void Toolbar::Pimpl::clean() void Toolbar::Pimpl::push(int nth) { lyxerr[Debug::GUI] << "Toolbar::push: trying to trigger no `" - << nth << '\'' << endl; + << nth << '\'' << endl; if (nth <= 0 || nth >= int(toollist.size())) { // item nth not found...