diff --git a/src/insets/Makefile.am b/src/insets/Makefile.am index 6bd454fcfd..722214985e 100644 --- a/src/insets/Makefile.am +++ b/src/insets/Makefile.am @@ -27,8 +27,6 @@ insets_o_SOURCES = \ insetinfo.h \ insetlabel.C \ insetlabel.h \ - insetlatex.C \ - insetlatex.h \ insetlatexaccent.C \ insetlatexaccent.h \ insetloa.C \ diff --git a/src/insets/figinset.C b/src/insets/figinset.C index b58b7dc4fc..92d1544938 100644 --- a/src/insets/figinset.C +++ b/src/insets/figinset.C @@ -743,7 +743,7 @@ static figdata *getfigdata(int wid, int hgh, string const & fname, while (i < bmpinsref) { if (bitmaps[i]->wid == wid && bitmaps[i]->hgh == hgh && - bitmaps[i]->flags == flags && bitmaps[i]->fname==fname && + bitmaps[i]->flags == flags && bitmaps[i]->fname == fname && bitmaps[i]->angle == angle) { bitmaps[i]->ref++; return bitmaps[i]; @@ -1008,10 +1008,10 @@ static char* NextToken(FILE *myfile) token = new char[256]; do { c = fgetc(myfile); - token[i++]=c; + token[i++]= c; } while (!feof(myfile) && !isspace(c)); - token[i-1]='\0'; /* just the end of a command */ + token[i-1]= '\0'; /* just the end of a command */ } return token; } @@ -1099,11 +1099,11 @@ void InsetFig::Draw(LyXFont font, LyXScreen &scr, int baseline, float &x) font.setFamily (LyXFont::SANS_FAMILY); font.setSize (LyXFont::SIZE_FOOTNOTE); string justname = OnlyFilename (fname); - font.drawString(justname,pm, + font.drawString(justname, pm, baseline - font.maxAscent() - 4, (int) x + 8); font.setSize (LyXFont::SIZE_TINY); - font.drawText (msg, strlen(msg),pm, + font.drawText (msg, strlen(msg), pm, baseline - 4, (int) x + 8); @@ -1239,12 +1239,12 @@ int InsetFig::Linuxdoc(string &/*file*/) int InsetFig::DocBook(string &file) { - string figurename=fname; + string figurename= fname; if(suffixIs(figurename, ".eps")) figurename.erase(fname.length() - 5); - file += "@"; + file += "@"; return 0; } @@ -1282,9 +1282,9 @@ void InsetFig::Edit(int, int) if (!form) { form = create_form_Figure(); fl_set_form_atclose(form->Figure, CancelCloseBoxCB, 0); - fl_set_object_return(form->Angle,FL_RETURN_ALWAYS); - fl_set_object_return(form->Width,FL_RETURN_ALWAYS); - fl_set_object_return(form->Height,FL_RETURN_ALWAYS); + fl_set_object_return(form->Angle, FL_RETURN_ALWAYS); + fl_set_object_return(form->Width, FL_RETURN_ALWAYS); + fl_set_object_return(form->Height, FL_RETURN_ALWAYS); } RestoreForm(); if (form->Figure->visible) { @@ -1722,7 +1722,7 @@ void InsetFig::GetPSSizes() char *p = 0; /* defaults to associated size - * ..just in case the PS-file is not readable (Henner,24-Aug-97) + * ..just in case the PS-file is not readable (Henner, 24-Aug-97) */ psx = 0; psy = 0; @@ -2154,7 +2154,7 @@ void InsetFig::BrowseFile() do { ProhibitInput(); if (once) { - p =fileDlg.Select(_("EPS Figure"), current_figure_path, + p = fileDlg.Select(_("EPS Figure"), current_figure_path, "*ps", string()); } else { p = fileDlg.Select(_("EPS Figure"), buf, diff --git a/src/insets/form_url.C b/src/insets/form_url.C index 8dd71897ed..cffbd71d6a 100644 --- a/src/insets/form_url.C +++ b/src/insets/form_url.C @@ -6,7 +6,7 @@ /* Form definition file generated with fdesign. */ #include FORMS_H_LOCATION -#include +#include #include "form_url.h" FD_form_url *create_form_form_url(void) @@ -15,22 +15,22 @@ FD_form_url *create_form_form_url(void) FD_form_url *fdui = (FD_form_url *) fl_calloc(1, sizeof(FD_form_url)); fdui->form_url = fl_bgn_form(FL_NO_BOX, 530, 150); - obj = fl_add_box(FL_UP_BOX,0,0,530,150,""); - fdui->url_name = obj = fl_add_input(FL_NORMAL_INPUT,50,20,460,30,_("Url")); - fl_set_input_shortcut(obj,scex(_("Url|#U")),1); + obj = fl_add_box(FL_UP_BOX, 0, 0, 530, 150, ""); + fdui->url_name = obj = fl_add_input(FL_NORMAL_INPUT, 50, 20, 460, 30, _("Url")); + fl_set_input_shortcut(obj, scex(_("Url|#U")), 1); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fdui->name_name = obj = fl_add_input(FL_NORMAL_INPUT,50,60,460,30,_("Name")); - fl_set_input_shortcut(obj,scex(_("Name|#N")),1); + fdui->name_name = obj = fl_add_input(FL_NORMAL_INPUT, 50, 60, 460, 30, _("Name")); + fl_set_input_shortcut(obj, scex(_("Name|#N")), 1); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fdui->radio_html = obj = fl_add_checkbutton(FL_PUSH_BUTTON,50,110,250,30,_("HTML type")); - fl_set_button_shortcut(obj,scex(_("HTML type|#H")),1); + fdui->radio_html = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 50, 110, 250, 30, _("HTML type")); + fl_set_button_shortcut(obj, scex(_("HTML type|#H")), 1); fl_set_object_gravity(obj, FL_NorthWest, FL_NorthEast); fl_set_object_resize(obj, FL_RESIZE_X); - fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON,410,110,100,30,_("Close")); + fdui->button_close = obj = fl_add_button(FL_RETURN_BUTTON, 410, 110, 100, 30, _("Close")); fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); - fl_set_object_callback(obj,C_InsetUrl_CloseUrlCB,0); + fl_set_object_callback(obj, C_InsetUrl_CloseUrlCB, 0); fl_end_form(); //fdui->form_url->fdui = fdui; diff --git a/src/insets/inset.C b/src/insets/inset.C index cad6369463..7a2293118e 100644 --- a/src/insets/inset.C +++ b/src/insets/inset.C @@ -1,12 +1,12 @@ /* This file is part of - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include diff --git a/src/insets/insetbib.C b/src/insets/insetbib.C index e91280a487..811941a7a3 100644 --- a/src/insets/insetbib.C +++ b/src/insets/insetbib.C @@ -75,24 +75,24 @@ FD_citation_form *create_form_citation_form(void) FD_citation_form *fdui = (FD_citation_form *) fl_calloc(1, sizeof(FD_citation_form)); fdui->citation_form = fl_bgn_form(FL_NO_BOX, 220, 130); - obj = fl_add_box(FL_UP_BOX,0,0,220,130,""); - fdui->key = obj = fl_add_text(FL_NORMAL_TEXT,20,10,60,30,_("Key:")); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_lalign(obj,FL_ALIGN_RIGHT); + obj = fl_add_box(FL_UP_BOX, 0, 0, 220, 130, ""); + fdui->key = obj = fl_add_text(FL_NORMAL_TEXT, 20, 10, 60, 30, _("Key:")); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_RIGHT); bibcombox = new Combox(FL_COMBOX_INPUT); - bibcombox->add(80,10,130,30, 120); + bibcombox->add(80, 10, 130, 30, 120); - obj = fl_add_button(FL_RETURN_BUTTON,20,90,90,30,_("OK")); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,bibitem_cb,1); - obj = fl_add_button(FL_NORMAL_BUTTON,120,90,90,30,idex(_("Cancel|^["))); - fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,bibitem_cb,0); - fdui->label = obj = fl_add_input(FL_NORMAL_INPUT,80,50,130,30,idex(_("Remark:|#R"))); - fl_set_input_shortcut(obj,scex(_("Remark:|#R")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); + obj = fl_add_button(FL_RETURN_BUTTON, 20, 90, 90, 30, _("OK")); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 1); + obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 90, 30, idex(_("Cancel|^["))); + fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 0); + fdui->label = obj = fl_add_input(FL_NORMAL_INPUT, 80, 50, 130, 30, idex(_("Remark:|#R"))); + fl_set_input_shortcut(obj, scex(_("Remark:|#R")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_end_form(); //fdui->citation_form->fdui = fdui; @@ -107,20 +107,20 @@ FD_bibitem_form *create_form_bibitem_form(void) FD_bibitem_form *fdui = (FD_bibitem_form *) fl_calloc(1, sizeof(FD_bibitem_form)); fdui->bibitem_form = fl_bgn_form(FL_NO_BOX, 220, 130); - obj = fl_add_box(FL_UP_BOX,0,0,220,130,""); - fdui->key = obj = fl_add_input(FL_NORMAL_INPUT,80,10,130,30,idex(_("Key:|#K"))); - fl_set_input_shortcut(obj,scex(_("Key:|#K")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - obj = fl_add_button(FL_RETURN_BUTTON,20,90,90,30,_("OK")); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,bibitem_cb,3); - obj = fl_add_button(FL_NORMAL_BUTTON,120,90,90,30,idex(_("Cancel|^["))); - fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,bibitem_cb,2); - fdui->label = obj = fl_add_input(FL_NORMAL_INPUT,80,50,130,30,idex(_("Label:|#L"))); - fl_set_input_shortcut(obj,scex(_("Label:|#L")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); + obj = fl_add_box(FL_UP_BOX, 0, 0, 220, 130, ""); + fdui->key = obj = fl_add_input(FL_NORMAL_INPUT, 80, 10, 130, 30, idex(_("Key:|#K"))); + fl_set_input_shortcut(obj, scex(_("Key:|#K")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + obj = fl_add_button(FL_RETURN_BUTTON, 20, 90, 90, 30, _("OK")); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 3); + obj = fl_add_button(FL_NORMAL_BUTTON, 120, 90, 90, 30, idex(_("Cancel|^["))); + fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, bibitem_cb, 2); + fdui->label = obj = fl_add_input(FL_NORMAL_INPUT, 80, 50, 130, 30, idex(_("Label:|#L"))); + fl_set_input_shortcut(obj, scex(_("Label:|#L")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); fl_end_form(); //fdui->bibitem_form->fdui = fdui; @@ -164,7 +164,7 @@ void InsetCitation::Edit(int, int) if (citation_form->citation_form->visible) { fl_raise_form(citation_form->citation_form); } else { - fl_show_form(citation_form->citation_form,FL_PLACE_MOUSE, FL_FULLBORDER, + fl_show_form(citation_form->citation_form, FL_PLACE_MOUSE, FL_FULLBORDER, _("Citation")); } } @@ -177,7 +177,7 @@ string InsetCitation::getScreenLabel() const temp += contents; if (!options.empty()) { - temp += "," + options; + temp += ", " + options; } return temp + ']'; @@ -228,7 +228,7 @@ void InsetBibKey::Write(FILE *file) } s += '{'; s += contents + '}'; - fprintf(file,"\\bibitem %s\n", s.c_str()); + fprintf(file, "\\bibitem %s\n", s.c_str()); } @@ -259,15 +259,15 @@ void InsetBibKey::Edit(int, int) bibitem_form->bibitem_form->u_vdata = this; // InsetBibtex uses the same form, with different labels fl_set_object_label(bibitem_form->key, idex(_("Key:|#K"))); - fl_set_button_shortcut(bibitem_form->key,scex(_("Key:|#K")),1); + fl_set_button_shortcut(bibitem_form->key, scex(_("Key:|#K")), 1); fl_set_object_label(bibitem_form->label, idex(_("Label:|#L"))); - fl_set_button_shortcut(bibitem_form->label,scex(_("Label:|#L")),1); + fl_set_button_shortcut(bibitem_form->label, scex(_("Label:|#L")), 1); fl_set_input(bibitem_form->key, getContents().c_str()); fl_set_input(bibitem_form->label, getOptions().c_str()); if (bibitem_form->bibitem_form->visible) { fl_raise_form(bibitem_form->bibitem_form); } else { - fl_show_form(bibitem_form->bibitem_form,FL_PLACE_MOUSE, + fl_show_form(bibitem_form->bibitem_form, FL_PLACE_MOUSE, FL_FULLBORDER, _("Bibliography item")); } @@ -317,14 +317,14 @@ int InsetBibtex::Latex(string &file, signed char /*fragile*/) // have a comma-separated list of bibliographies string db_in, adb, db_out; db_in = getContents(); - db_in=split(db_in, adb, ','); + db_in= split(db_in, adb, ','); while(!adb.empty()) { if (!owner->niceFile && - IsFileReadable(MakeAbsPath(adb,owner->filepath)+".bib")) - adb = MakeAbsPath(adb,owner->filepath); + IsFileReadable(MakeAbsPath(adb, owner->filepath)+".bib")) + adb = MakeAbsPath(adb, owner->filepath); db_out += adb; db_out += ','; - db_in=split(db_in, adb,','); + db_in= split(db_in, adb,','); } db_out = strip(db_out, ','); // Idem, but simpler @@ -360,12 +360,12 @@ string InsetBibtex::getKeys() // BIBINPUTS string bibfiles, linebuf, tmp, keys; bibfiles = getContents(); - bibfiles=split(bibfiles, tmp, ','); + bibfiles= split(bibfiles, tmp, ','); while(!tmp.empty()) { - if (IsFileReadable(MakeAbsPath(tmp,owner->filepath)+".bib")) - tmp = MakeAbsPath(tmp,owner->filepath)+".bib"; + if (IsFileReadable(MakeAbsPath(tmp, owner->filepath)+".bib")) + tmp = MakeAbsPath(tmp, owner->filepath)+".bib"; else { - tmp = FileOpenSearch(GetEnvPath("BIBINPUTS"),tmp,"bib"); + tmp = FileOpenSearch(GetEnvPath("BIBINPUTS"), tmp, "bib"); if (tmp.empty()) tmp = FileOpenSearch(GetEnvPath("BIBINPUT"), tmp, "bib"); @@ -377,7 +377,7 @@ string InsetBibtex::getKeys() // All it does is to look for lines starting in @ and not // being @preamble and @string entries. // It does NOT do any syntax checking! - FilePtr file(tmp,FilePtr::read); + FilePtr file(tmp, FilePtr::read); char c; // On some systems where feof() is a macro, @@ -396,7 +396,7 @@ string InsetBibtex::getKeys() if (!prefixIs(tmp, "@string") && !prefixIs(tmp, "@preamble") ) { linebuf = split(linebuf, tmp,','); if (!tmp.empty()) - keys += strip(tmp) + ","; + keys += strip(tmp) + ", "; } } linebuf.clear(); @@ -406,7 +406,7 @@ string InsetBibtex::getKeys() } } // Get next file name - bibfiles=split(bibfiles, tmp, ','); + bibfiles= split(bibfiles, tmp, ','); } return keys; } @@ -454,10 +454,10 @@ bool InsetBibtex::delDatabase(string const & db) int n = tokenPos(contents, ',', bd); if (n > 0) { // Weird code, would someone care to explain this?(Lgb) - string tmp(","); + string tmp(", "); tmp += bd; - contents = subst(contents, tmp.c_str(), ","); - } else if (n==0) + contents = subst(contents, tmp.c_str(), ", "); + } else if (n == 0) contents = split(contents, bd, ','); else return false; diff --git a/src/insets/insetbib.h b/src/insets/insetbib.h index 3c07f55a29..54ec1df173 100644 --- a/src/insets/insetbib.h +++ b/src/insets/insetbib.h @@ -1,13 +1,13 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1995 Matthias Ettrich * Copyright (C) 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_BIB_H #define INSET_BIB_H diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index 1457cad889..7b2582d579 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -6,7 +6,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -113,21 +113,21 @@ void InsetCommand::scanCommand(string const & cmd) for (string::size_type i = 0; i < cmd.length(); ++i) { char c = cmd[i]; - if ((state==Command && c == ' ') || - (state==Command && c == '[') || - (state==Command && c == '{')) { + if ((state == Command && c == ' ') || + (state == Command && c == '[') || + (state == Command && c == '{')) { state = WS; } - if ((state==Option && c == ']') || - (state==Content && c == '}')) { - if (nestdepth==0) { + if ((state == Option && c == ']') || + (state == Content && c == '}')) { + if (nestdepth == 0) { state = WS; } else { nestdepth--; } } - if ((state==Option && c == '[') || - (state==Content && c == '{')) { + if ((state == Option && c == '[') || + (state == Content && c == '{')) { nestdepth++; } switch (state) { diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index b1a53e82bf..27ceea85db 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -1,13 +1,13 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1995 Matthias Ettrich * Copyright (C) 1996-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_LATEXCOMMAND_H #define INSET_LATEXCOMMAND_H diff --git a/src/insets/inseterror.C b/src/insets/inseterror.C index 1d4bd36a1d..61afb4717a 100644 --- a/src/insets/inseterror.C +++ b/src/insets/inseterror.C @@ -6,7 +6,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -14,7 +14,6 @@ #pragma implementation #endif -#include "definitions.h" #include "inseterror.h" #include "lyxdraw.h" #include "gettext.h" @@ -79,7 +78,7 @@ void InsetError::Draw(LyXFont font, LyXScreen & scr, x += 1; scr.fillRectangle(gc_lighted, int(x), baseline - Ascent(font)+1, - Width(font)-2,Ascent(font)+ Descent(font)-2); + Width(font)-2, Ascent(font)+ Descent(font)-2); scr.drawRectangle(gc_foot, int(x), baseline-Ascent(font)+1, Width(font)-2, Ascent(font)+Descent(font)-2); @@ -159,10 +158,11 @@ void InsetError::Edit(int, int) if (!form) { FL_OBJECT * obj; form = fl_bgn_form(FL_UP_BOX, ow, oh); - strobj = fl_add_box(FL_FRAME_BOX,10,10,380,180,""); - fl_set_object_color(strobj,FL_MCOL,FL_MCOL); + strobj = fl_add_box(FL_FRAME_BOX, 10, 10, 380, 180, ""); + fl_set_object_color(strobj, FL_MCOL, FL_MCOL); fl_set_object_gravity(strobj, FL_NorthWest, FL_SouthEast); - obj = fl_add_button(FL_RETURN_BUTTON,140,200,120,30,_("Close")); + obj = fl_add_button(FL_RETURN_BUTTON, 140, 200, 120, 30, + _("Close")); fl_set_object_callback(obj, C_InsetError_CloseErrorCB, 0); obj->u_vdata = this; fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast); @@ -174,14 +174,14 @@ void InsetError::Edit(int, int) if (form->visible) { fl_raise_form(form); } else { - fl_show_form(form,FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, - _("LaTeX Error")); + fl_show_form(form, FL_PLACE_MOUSE | FL_FREE_SIZE, + FL_FULLBORDER, _("LaTeX Error")); fl_set_form_minsize(form, ow, oh); } } -Inset* InsetError::Clone() +Inset * InsetError::Clone() { InsetError * result = new InsetError(contents); return result; diff --git a/src/insets/inseterror.h b/src/insets/inseterror.h index 1bde3a4d03..346e11d042 100644 --- a/src/insets/inseterror.h +++ b/src/insets/inseterror.h @@ -1,12 +1,12 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1995 Matthias Ettrich * - *======================================================*/ + * ====================================================== */ #ifndef INSET_ERROR_H #define INSET_ERROR_H diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 9353fb97dc..f34bae7b7a 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -35,47 +35,47 @@ FD_include * create_form_include(void) FD_include * fdui = (FD_include *) fl_calloc(1, sizeof(FD_include)); fdui->include = fl_bgn_form(FL_NO_BOX, 340, 210); - obj = fl_add_box(FL_UP_BOX,0,0,340,210,""); - obj = fl_add_frame(FL_ENGRAVED_FRAME,10,70,160,90,""); - fdui->browsebt = obj = fl_add_button(FL_NORMAL_BUTTON,230,30,100,30,idex(_("Browse|#B"))); - fl_set_button_shortcut(obj,scex(_("Browse|#B")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,0); - fdui->flag1 = obj = fl_add_checkbutton(FL_PUSH_BUTTON,180,70,150,30,idex(_("Don't typeset|#D"))); - fl_set_button_shortcut(obj,scex(_("Don't typeset|#D")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - obj = fl_add_button(FL_RETURN_BUTTON,120,170,100,30,_("OK")); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,1); - obj = fl_add_button(FL_NORMAL_BUTTON,230,170,100,30,idex(_("Cancel|^["))); - fl_set_button_shortcut(obj,scex(_("Cancel|^[")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,2); - obj = fl_add_button(FL_NORMAL_BUTTON,230,130,100,30,idex(_("Load|#L"))); - fl_set_button_shortcut(obj,scex(_("Load|#L")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,5); - fdui->input = obj = fl_add_input(FL_NORMAL_INPUT,10,30,210,30,idex(_("File name:|#F"))); - fl_set_input_shortcut(obj,scex(_("File name:|#F")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_lalign(obj,FL_ALIGN_TOP_LEFT); - fdui->flag41 = obj = fl_add_checkbutton(FL_PUSH_BUTTON,180,100,150,30,idex(_("Visible space|#s"))); - fl_set_button_shortcut(obj,scex(_("Visible space|#s")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); + obj = fl_add_box(FL_UP_BOX, 0, 0, 340, 210, ""); + obj = fl_add_frame(FL_ENGRAVED_FRAME, 10, 70, 160, 90, ""); + fdui->browsebt = obj = fl_add_button(FL_NORMAL_BUTTON, 230, 30, 100, 30, idex(_("Browse|#B"))); + fl_set_button_shortcut(obj, scex(_("Browse|#B")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 0); + fdui->flag1 = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 180, 70, 150, 30, idex(_("Don't typeset|#D"))); + fl_set_button_shortcut(obj, scex(_("Don't typeset|#D")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + obj = fl_add_button(FL_RETURN_BUTTON, 120, 170, 100, 30, _("OK")); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 1); + obj = fl_add_button(FL_NORMAL_BUTTON, 230, 170, 100, 30, idex(_("Cancel|^["))); + fl_set_button_shortcut(obj, scex(_("Cancel|^[")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 2); + obj = fl_add_button(FL_NORMAL_BUTTON, 230, 130, 100, 30, idex(_("Load|#L"))); + fl_set_button_shortcut(obj, scex(_("Load|#L")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 5); + fdui->input = obj = fl_add_input(FL_NORMAL_INPUT, 10, 30, 210, 30, idex(_("File name:|#F"))); + fl_set_input_shortcut(obj, scex(_("File name:|#F")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_lalign(obj, FL_ALIGN_TOP_LEFT); + fdui->flag41 = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 180, 100, 150, 30, idex(_("Visible space|#s"))); + fl_set_button_shortcut(obj, scex(_("Visible space|#s")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); fdui->include_grp = fl_bgn_group(); - fdui->flag4 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,130,160,30,idex(_("Verbatim|#V"))); - fl_set_button_shortcut(obj,scex(_("Verbatim|#V")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,10); - fdui->flag2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,100,160,30,idex(_("Use input|#i"))); - fl_set_button_shortcut(obj,scex(_("Use input|#i")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,11); - fdui->flag3 = obj = fl_add_checkbutton(FL_RADIO_BUTTON,10,70,160,30,idex(_("Use include|#U"))); - fl_set_button_shortcut(obj,scex(_("Use include|#U")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - fl_set_object_callback(obj,include_cb,11); + fdui->flag4 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 130, 160, 30, idex(_("Verbatim|#V"))); + fl_set_button_shortcut(obj, scex(_("Verbatim|#V")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 10); + fdui->flag2 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 100, 160, 30, idex(_("Use input|#i"))); + fl_set_button_shortcut(obj, scex(_("Use input|#i")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 11); + fdui->flag3 = obj = fl_add_checkbutton(FL_RADIO_BUTTON, 10, 70, 160, 30, idex(_("Use include|#U"))); + fl_set_button_shortcut(obj, scex(_("Use include|#U")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + fl_set_object_callback(obj, include_cb, 11); fl_end_group(); fl_end_form(); @@ -252,7 +252,7 @@ void InsetInclude::Edit(int, int) if (form->include->visible) { fl_raise_form(form->include); } else { - fl_show_form(form->include,FL_PLACE_MOUSE, FL_FULLBORDER, + fl_show_form(form->include, FL_PLACE_MOUSE, FL_FULLBORDER, _("Include")); } } @@ -268,7 +268,7 @@ void InsetInclude::Read(LyXLex & lex) { InsetCommand::Read(lex); - if (getCmdName()=="include") + if (getCmdName() == "include") setInclude(); else if (getCmdName() == "input") setInput(); @@ -292,9 +292,9 @@ string InsetInclude::getScreenLabel() const temp += ": "; if (contents.empty()) { - temp+="???"; + temp+= "???"; } else { - temp+=contents; + temp+= contents; } return temp; } @@ -360,7 +360,7 @@ int InsetInclude::Latex(string & file, signed char /*fragile*/) writefile = AddName(master->tmppath, incfile); } else writefile = getFileName(); - writefile = ChangeExtension(writefile,".tex",false); + writefile = ChangeExtension(writefile, ".tex", false); lyxerr[Debug::LATEX] << "incfile:" << incfile << endl; lyxerr[Debug::LATEX] << "writefile:" << writefile << endl; @@ -385,7 +385,7 @@ int InsetInclude::Latex(string & file, signed char /*fragile*/) } else { file += '\\'; file += command + '{'; - file += ChangeExtension(incfile, ".tex", false) + file += ChangeExtension(incfile, ".tex", false) + '}'; } } else { @@ -393,7 +393,7 @@ int InsetInclude::Latex(string & file, signed char /*fragile*/) // file really have .tex file += '\\'; file += command + '{'; - file += ChangeExtension(incfile, string(), false) + file += ChangeExtension(incfile, string(), false) + '}'; } diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index a37d9a2b79..0373eeb631 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -6,7 +6,7 @@ * * Copyright (C) 1997 LyX Team (this file was created this year) * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_INCLUDE_H #define INSET_INCLUDE_H @@ -93,7 +93,7 @@ public: */ bool isVerb() const; /// - bool isVerbVisibleSpace() const { return flag==InsetInclude::VERBAST;} + bool isVerbVisibleSpace() const { return flag == InsetInclude::VERBAST;} /// bool isInclude() const { return flag == InsetInclude::INCLUDE;} /// @@ -112,7 +112,7 @@ private: /// enum Include_Flags { /// - INCLUDE=0, + INCLUDE= 0, /// VERB = 1, /// @@ -135,7 +135,7 @@ private: inline bool InsetInclude::isVerb() const { - return (bool)(flag==InsetInclude::VERB || flag==InsetInclude::VERBAST); + return (bool)(flag == InsetInclude::VERB || flag == InsetInclude::VERBAST); } @@ -179,10 +179,10 @@ void InsetInclude::setVerb() inline void InsetInclude::setVisibleSpace(bool b) { - if (b && flag==InsetInclude::VERB) { + if (b && flag == InsetInclude::VERB) { setCmdName("verbatiminput*"); flag = InsetInclude::VERBAST; - } else if (!b && flag==InsetInclude::VERBAST) { + } else if (!b && flag == InsetInclude::VERBAST) { setCmdName("verbatiminput"); flag = InsetInclude::VERB; } diff --git a/src/insets/insetindex.C b/src/insets/insetindex.C index a4868a4069..1156066e6d 100644 --- a/src/insets/insetindex.C +++ b/src/insets/insetindex.C @@ -48,19 +48,19 @@ FD_index_form * create_form_index_form() FD_index_form *fdui = (FD_index_form *) fl_calloc(1, sizeof(FD_index_form)); fdui->index_form = fl_bgn_form(FL_NO_BOX, 258, 196); - obj = fl_add_box(FL_UP_BOX,0,0,258,196,""); - fdui->key = obj = fl_add_input(FL_NORMAL_INPUT,93,26,130,30, + obj = fl_add_box(FL_UP_BOX, 0, 0, 258, 196, ""); + fdui->key = obj = fl_add_input(FL_NORMAL_INPUT, 93, 26, 130, 30, idex(_("Keyword:|#K"))); - fl_set_object_shortcut(obj,scex(_("Keyword:|#K")),1); - fl_set_object_lsize(obj,FL_NORMAL_SIZE); - obj = fl_add_button(FL_RETURN_BUTTON,50,140,80,30,_("OK")); + fl_set_object_shortcut(obj, scex(_("Keyword:|#K")), 1); + fl_set_object_lsize(obj, FL_NORMAL_SIZE); + obj = fl_add_button(FL_RETURN_BUTTON, 50, 140, 80, 30, _("OK")); obj->u_vdata = index_form; - fl_set_object_callback(obj,index_cb,1); - obj = fl_add_button(FL_NORMAL_BUTTON,150,140,80,30, + fl_set_object_callback(obj, index_cb, 1); + obj = fl_add_button(FL_NORMAL_BUTTON, 150, 140, 80, 30, idex(_("Cancel|^["))); - fl_set_object_shortcut(obj,scex(_("Cancel|^[")),1); + fl_set_object_shortcut(obj, scex(_("Cancel|^[")), 1); obj->u_vdata = index_form; - fl_set_object_callback(obj,index_cb,0); + fl_set_object_callback(obj, index_cb, 0); fl_end_form(); return fdui; diff --git a/src/insets/insetindex.h b/src/insets/insetindex.h index 6470404e28..bdad6b47c1 100644 --- a/src/insets/insetindex.h +++ b/src/insets/insetindex.h @@ -1,13 +1,13 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich * Copyright 1996-1999 the LyX Team. * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_INDEX_H #define INSET_INDEX_H diff --git a/src/insets/insetinfo.C b/src/insets/insetinfo.C index 21a7f06680..189730b742 100644 --- a/src/insets/insetinfo.C +++ b/src/insets/insetinfo.C @@ -6,7 +6,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -186,12 +186,12 @@ void InsetInfo::Edit(int, int) if (!form) { FL_OBJECT *obj; - form = fl_bgn_form(FL_UP_BOX,400,180); - strobj = obj = fl_add_input(FL_MULTILINE_INPUT,10,10,380,120,""); - fl_set_object_color(obj,FL_MCOL,FL_MCOL); + form = fl_bgn_form(FL_UP_BOX, 400, 180); + strobj = obj = fl_add_input(FL_MULTILINE_INPUT, 10, 10, 380, 120, ""); + fl_set_object_color(obj, FL_MCOL, FL_MCOL); fl_set_object_resize(obj, FL_RESIZE_ALL); fl_set_object_gravity(obj, NorthWestGravity, SouthEastGravity); - obj = fl_add_button(FL_NORMAL_BUTTON,130,140,120,30,idex(_("Close|#C^["))); + obj = fl_add_button(FL_NORMAL_BUTTON, 130, 140, 120, 30, idex(_("Close|#C^["))); fl_set_object_resize(obj, FL_RESIZE_NONE); fl_set_object_gravity(obj, SouthEastGravity, SouthEastGravity); fl_set_object_callback(obj, C_InsetInfo_CloseInfoCB, 0); @@ -204,7 +204,7 @@ void InsetInfo::Edit(int, int) if (form->visible) { fl_raise_form(form); } else { - fl_show_form(form,FL_PLACE_MOUSE | FL_FREE_SIZE,FL_FULLBORDER, + fl_show_form(form, FL_PLACE_MOUSE | FL_FREE_SIZE, FL_FULLBORDER, _("Note")); if (ow < 0) { ow = form->w; diff --git a/src/insets/insetinfo.h b/src/insets/insetinfo.h index 5023a069fd..b2f3f5b57b 100644 --- a/src/insets/insetinfo.h +++ b/src/insets/insetinfo.h @@ -1,13 +1,13 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 the LyX Team. * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_INFO_H #define INSET_INFO_H diff --git a/src/insets/insetlabel.C b/src/insets/insetlabel.C index 6ef9e342a8..665485d3ee 100644 --- a/src/insets/insetlabel.C +++ b/src/insets/insetlabel.C @@ -6,7 +6,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -82,7 +82,7 @@ string InsetLabel::escape(string const & lab) const { char hexdigit[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; string enc; - for (string::size_type i=0; i < lab.length(); ++i) { + for (string::size_type i= 0; i < lab.length(); ++i) { unsigned char c = lab[i]; if (c >= 128 || c == '=' || c == '%') { enc += '='; diff --git a/src/insets/insetlabel.h b/src/insets/insetlabel.h index bebe75df87..bf7245493c 100644 --- a/src/insets/insetlabel.h +++ b/src/insets/insetlabel.h @@ -7,7 +7,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team * - *======================================================*/ + * ====================================================== */ #ifndef INSET_LABEL_H #define INSET_LABEL_H diff --git a/src/insets/insetlatex.C b/src/insets/insetlatex.C index dbc6fd8262..590086a8dc 100644 --- a/src/insets/insetlatex.C +++ b/src/insets/insetlatex.C @@ -1,12 +1,12 @@ /* This file is part of - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -14,7 +14,6 @@ #pragma implementation #endif -#include "definitions.h" #include "insetlatex.h" #include "lyxdraw.h" @@ -67,7 +66,7 @@ void InsetLatex::Draw(LyXFont font, LyXScreen & scr, scr.fillRectangle(gc_lighted, int(x), baseline - Ascent(font) +1 , Width(font) - 2, Ascent(font) + Descent(font) -2); - scr.drawRectangle(gc_foot,int(x), baseline - Ascent(font) + 1, + scr.drawRectangle(gc_foot, int(x), baseline - Ascent(font) + 1, Width(font)-2, Ascent(font)+Descent(font)-2); scr.drawString(font, contents, baseline, int(x+2)); diff --git a/src/insets/insetlatex.h b/src/insets/insetlatex.h index 8c163183ee..ae2a493c07 100644 --- a/src/insets/insetlatex.h +++ b/src/insets/insetlatex.h @@ -6,7 +6,7 @@ * * Copyright (C) 1995 Matthias Ettrich * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_LATEX_H #define INSET_LATEX_H diff --git a/src/insets/insetlatexaccent.C b/src/insets/insetlatexaccent.C index 169c02a2b0..489ce5da83 100644 --- a/src/insets/insetlatexaccent.C +++ b/src/insets/insetlatexaccent.C @@ -1,12 +1,12 @@ /* This file is part of - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -80,7 +80,7 @@ void InsetLatexAccent::checkContents() tmp += contents[2]; tmp += '}'; contents = tmp; - } else if (contents.length()==4 && contents[2] == ' ') { + } else if (contents.length() == 4 && contents[2] == ' ') { string tmp; tmp += contents[0]; tmp += contents[1]; @@ -88,8 +88,8 @@ void InsetLatexAccent::checkContents() tmp += contents[3]; tmp += '}'; contents = tmp; - } else if (contents.length()==4 && contents[2] == '\\' - && (contents[3]== 'i' || contents[3]== 'j')) { + } else if (contents.length() == 4 && contents[2] == '\\' + && (contents[3] == 'i' || contents[3] == 'j')) { string tmp; tmp += contents[0]; tmp += contents[1]; @@ -246,8 +246,8 @@ void InsetLatexAccent::checkContents() temp += '\\'; temp += char(ic); for(string::size_type j = 4; j < contents.length(); ++j) - temp+=contents[j]; - contents=temp; + temp+= contents[j]; + contents= temp; i++; remdot = true; } @@ -287,7 +287,7 @@ int InsetLatexAccent::Descent(LyXFont const & font) const { int max; if (candisp) { - if (ic==' ') + if (ic == ' ') max = font.descent('a'); else max = font.descent(ic); @@ -357,7 +357,7 @@ void InsetLatexAccent::Draw(LyXFont font, int baseline, float & x) { - if (lyxrc->font_norm=="iso8859-9") + if (lyxrc->font_norm == "iso8859-9") if (DisplayISO8859_9 (font, scr, baseline, x)) return; @@ -402,7 +402,7 @@ void InsetLatexAccent::Draw(LyXFont font, font.ascent('x')-1); } - // now the rest - draw within (x,y, x+wid, y+hg) + // now the rest - draw within (x, y, x+wid, y+hg) switch (modtype) { case ACUTE: // acute { @@ -412,7 +412,7 @@ void InsetLatexAccent::Draw(LyXFont font, } case GRAVE: // grave { - scr.drawLine(pgc,int(x2), int(y+hg35), + scr.drawLine(pgc, int(x2), int(y+hg35), int(x2-hg35), y); break; } @@ -455,7 +455,7 @@ void InsetLatexAccent::Draw(LyXFont font, case UNDERDOT: // underdot case DOT: // dot { - scr.drawArc(pgc,int(x2), y+(hg/2), + scr.drawArc(pgc, int(x2), y+(hg/2), 1, 1, 0, 360*64); break; } diff --git a/src/insets/insetlatexaccent.h b/src/insets/insetlatexaccent.h index acf1afbfd6..0548009af5 100644 --- a/src/insets/insetlatexaccent.h +++ b/src/insets/insetlatexaccent.h @@ -1,12 +1,12 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1995 Matthias Ettrich * - *======================================================*/ + * ====================================================== */ #ifndef INSET_LATEX_ACCENT_H #define INSET_LATEX_ACCENT_H @@ -129,7 +129,7 @@ private: /// modifier type ACCENT_TYPES modtype; - /// remove dot from 'i' and 'j' or transform l,L into lslash,LSLaSH + /// remove dot from 'i' and 'j' or transform l, L into lslash, LSLaSH bool remdot; /// add something to ascent - accent at the top bool plusasc; diff --git a/src/insets/insetloa.C b/src/insets/insetloa.C index 8578b959ed..33d14a39ce 100644 --- a/src/insets/insetloa.C +++ b/src/insets/insetloa.C @@ -7,7 +7,7 @@ * Copyright (C) 1995 Matthias Ettrich * Copyright (C) 1996-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ // Created by Bernhard 970908 diff --git a/src/insets/insetloa.h b/src/insets/insetloa.h index 91434c520a..3655d3ac1c 100644 --- a/src/insets/insetloa.h +++ b/src/insets/insetloa.h @@ -7,7 +7,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1996-1999 the LyX Team. * - *======================================================*/ + * ====================================================== */ #ifndef INSET_LOA_H #define INSET_LOA_H @@ -28,7 +28,7 @@ public: /// InsetLOA(): InsetCommand("listofalgorithms") {} /// - InsetLOA(Buffer * b): InsetCommand("listofalgorithms"),owner(b) {} + InsetLOA(Buffer * b): InsetCommand("listofalgorithms"), owner(b) {} /// void Validate(LaTeXFeatures & features) const; /// diff --git a/src/insets/insetlof.h b/src/insets/insetlof.h index 0de6628d36..f091565bc5 100644 --- a/src/insets/insetlof.h +++ b/src/insets/insetlof.h @@ -7,7 +7,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1996-1999 the LyX Team. * - *======================================================*/ + * ====================================================== */ #ifndef INSET_LOF_H #define INSET_LOF_H @@ -28,7 +28,7 @@ public: /// InsetLOF(): InsetCommand("listoffigures") {} /// - InsetLOF(Buffer * b): InsetCommand("listoffigures"),owner(b) {} + InsetLOF(Buffer * b): InsetCommand("listoffigures"), owner(b) {} /// Inset * Clone() { return new InsetLOF(owner); } /// diff --git a/src/insets/insetlot.h b/src/insets/insetlot.h index edc7bd78fa..e3fae9308e 100644 --- a/src/insets/insetlot.h +++ b/src/insets/insetlot.h @@ -7,7 +7,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1996-1999 LyX Team * - *======================================================*/ + * ====================================================== */ #ifndef INSET_LOT_H #define INSET_LOT_H diff --git a/src/insets/insetparent.C b/src/insets/insetparent.C index 525709accd..bd788a4a26 100644 --- a/src/insets/insetparent.C +++ b/src/insets/insetparent.C @@ -1,11 +1,11 @@ /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1997-1999 LyX Team * - * ======================================================*/ + * ====================================================== */ // Created by asierra 970813 diff --git a/src/insets/insetparent.h b/src/insets/insetparent.h index 3c50159b9a..cfc8e3e53a 100644 --- a/src/insets/insetparent.h +++ b/src/insets/insetparent.h @@ -1,12 +1,12 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1997-1999 LyX Team * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_PARENT_H #define INSET_PARENT_H @@ -29,7 +29,7 @@ public: /// Non-standard LyX macro InsetParent(): InsetCommand("lyxparent") { } /// - InsetParent(string fn, Buffer * owner=0); + InsetParent(string fn, Buffer * owner= 0); /// ~InsetParent() {} /// diff --git a/src/insets/insetquotes.C b/src/insets/insetquotes.C index 889c2fe295..4ec6d5805c 100644 --- a/src/insets/insetquotes.C +++ b/src/insets/insetquotes.C @@ -6,7 +6,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team. * - * ======================================================*/ + * ====================================================== */ #include @@ -32,29 +32,29 @@ extern BufferView * current_view; // codes used to read/write quotes to LyX files static char const * const language_char = "esgpfa"; static char const * const side_char = "lr" ; -static char const * const times_char ="sd"; +static char const * const times_char = "sd"; // List of known quote chars static char const * const quote_char = ",'`<>"; -// Index of chars used for the quote. Index is [side,language] +// Index of chars used for the quote. Index is [side, language] int quote_index[2][6] = { { 2, 1, 0, 0, 3, 4 }, // "'',,<>" { 1, 1, 2, 1, 4, 3 } }; // "`'`'><" // Corresponding LaTeX code, for double and single quotes. -static char const * const latex_quote_t1[2][5] = +static char const * const latex_quote_t1[2][5] = { { "\\quotesinglbase{}", "'", "`", "\\guilsinglleft{}", "\\guilsinglright{}" }, { ",,", "''", "``", "<<", ">>" } }; -static char const * const latex_quote_ot1[2][5] = +static char const * const latex_quote_ot1[2][5] = { { "\\quotesinglbase{}", "'", "`", "\\guilsinglleft{}", "\\guilsinglright{}" }, { "\\quotedblbase{}", "''", "``", "\\guillemotleft{}", "\\guillemotright{}" } }; -static char const * const latex_quote_babel[2][5] = +static char const * const latex_quote_babel[2][5] = { { "\\glq{}", "'", "`", "\\flq{}", "\\frq{}" }, { "\\glqq{}", "''", "``", "\\flqq{}", "\\frqq{}" } }; @@ -78,8 +78,9 @@ InsetQuotes::InsetQuotes(char c, BufferParams const & params) // Decide whether left or right switch(c) { case ' ': case '(': case '{': case '[': case '-': case ':': - case LYX_META_HFILL: case LYX_META_PROTECTED_SEPARATOR: - case LYX_META_NEWLINE: + case LyXParagraph::META_HFILL: + case LyXParagraph::META_PROTECTED_SEPARATOR: + case LyXParagraph::META_NEWLINE: side = InsetQuotes::LeftQ; // left quote break; default: @@ -98,37 +99,37 @@ void InsetQuotes::ParseString(string const & s) str = "eld"; } - for (i=0;i<6;i++) { + for (i= 0;i<6;i++) { if (str[0] == language_char[i]) { language = (InsetQuotes::quote_language)i; break; } } - if (i>=6) { + if (i>= 6) { lyxerr << "ERROR (InsetQuotes::InsetQuotes):" " bad language specification." << endl; language = InsetQuotes::EnglishQ; } - for (i=0;i<2;i++) { + for (i= 0;i<2;i++) { if (str[1] == side_char[i]) { side = (InsetQuotes::quote_side)i; break; } } - if (i>=2) { + if (i>= 2) { lyxerr << "ERROR (InsetQuotes::InsetQuotes):" " bad side specification." << endl; side = InsetQuotes::LeftQ; } - for (i=0;i<2;i++) { + for (i= 0;i<2;i++) { if (str[2] == times_char[i]) { times = (InsetQuotes::quote_times)i; break; } } - if (i>=2) { + if (i>= 2) { lyxerr << "ERROR (InsetQuotes::InsetQuotes):" " bad times specification." << endl; times = InsetQuotes::DoubleQ; @@ -227,7 +228,7 @@ int InsetQuotes::Latex(FILE * file, signed char /*fragile*/) int InsetQuotes::Latex(string & file, signed char /*fragile*/) { - string doclang = + string doclang = current_view->buffer()->GetLanguage(); int quoteind = quote_index[side][language]; string qstr; diff --git a/src/insets/insetquotes.h b/src/insets/insetquotes.h index 91c105e358..49dae58aeb 100644 --- a/src/insets/insetquotes.h +++ b/src/insets/insetquotes.h @@ -7,7 +7,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 The LyX Team * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_QUOTES_H #define INSET_QUOTES_H diff --git a/src/insets/insetref.C b/src/insets/insetref.C index 8ef66fdc9e..b10dcd2c03 100644 --- a/src/insets/insetref.C +++ b/src/insets/insetref.C @@ -78,7 +78,7 @@ int InsetRef::Latex(FILE * file, signed char /*fragile*/) fprintf(file, "%s", escape(getCommand()).c_str()); else { string ns; - InsetCommand clone= InsetCommand(getCmdName(),getContents(),ns); + InsetCommand clone= InsetCommand(getCmdName(), getContents(), ns); fprintf(file, "%s", escape(clone.getCommand()).c_str()); } return 0; @@ -91,7 +91,7 @@ int InsetRef::Latex(string & file, signed char /*fragile*/) file += escape(getCommand()); else { string ns; - InsetCommand clone= InsetCommand(getCmdName(),getContents(),ns); + InsetCommand clone= InsetCommand(getCmdName(), getContents(), ns); file += escape(clone.getCommand()); } return 0; @@ -123,8 +123,8 @@ string InsetRef::escape(string const & lab) const { '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; string enc; for (string::size_type i = 0; i < lab.length(); ++i) { - unsigned char c=lab[i]; - if (c >= 128 || c=='=' || c=='%') { + unsigned char c= lab[i]; + if (c >= 128 || c == '=' || c == '%') { enc += '='; enc += hexdigit[c>>4]; enc += hexdigit[c & 15]; diff --git a/src/insets/insetref.h b/src/insets/insetref.h index 857e651402..af85500a30 100644 --- a/src/insets/insetref.h +++ b/src/insets/insetref.h @@ -6,7 +6,7 @@ * * Copyright (C) 1997 LyX Team (this file was created this year) * - *======================================================*/ + * ====================================================== */ #ifndef INSET_REF_H #define INSET_REF_H diff --git a/src/insets/insetspecialchar.C b/src/insets/insetspecialchar.C index 019e238195..111b55218a 100644 --- a/src/insets/insetspecialchar.C +++ b/src/insets/insetspecialchar.C @@ -5,7 +5,7 @@ * * Copyright 1997 Asger Alstrup * - * ======================================================*/ + * ====================================================== */ #include @@ -136,13 +136,13 @@ void InsetSpecialChar::Read(LyXLex & lex) lex.nextToken(); string command = lex.GetString(); - if (command=="\\-") + if (command == "\\-") kind = HYPHENATION; - else if (command=="\\@.") + else if (command == "\\@.") kind = END_OF_SENTENCE; - else if (command=="\\ldots{}") + else if (command == "\\ldots{}") kind = LDOTS; - else if (command=="\\menuseparator") + else if (command == "\\menuseparator") kind = MENU_SEPARATOR; else lex.printError("InsetSpecialChar: Unknown kind: `$$Token'"); diff --git a/src/insets/insetspecialchar.h b/src/insets/insetspecialchar.h index e01b32e6d4..354b5a2441 100644 --- a/src/insets/insetspecialchar.h +++ b/src/insets/insetspecialchar.h @@ -1,12 +1,12 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1997 Asger Alstrup * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_SPECIALCHAR_H #define INSET_SPECIALCHAR_H diff --git a/src/insets/insettoc.h b/src/insets/insettoc.h index 8be5c8bebc..34e1dbc0ed 100644 --- a/src/insets/insettoc.h +++ b/src/insets/insettoc.h @@ -7,7 +7,7 @@ * Copyright 1995 Matthias Ettrich * Copyright 1996-1999 The LyX Team. * - *======================================================*/ + * ====================================================== */ #ifndef INSET_TOC_H #define INSET_TOC_H @@ -28,7 +28,7 @@ public: /// InsetTOC(): InsetCommand("tableofcontents") {} /// - InsetTOC(Buffer * b): InsetCommand("tableofcontents"),owner(b) {} + InsetTOC(Buffer * b): InsetCommand("tableofcontents"), owner(b) {} /// Inset * Clone() { return new InsetTOC(owner); } /// diff --git a/src/insets/inseturl.C b/src/insets/inseturl.C index 436d68bb67..76a231a369 100644 --- a/src/insets/inseturl.C +++ b/src/insets/inseturl.C @@ -117,7 +117,7 @@ void InsetUrl::Edit(int, int) if (!fd_form_url) { fd_form_url = create_form_form_url(); fd_form_url->button_close->u_vdata = this; - fl_set_form_atclose(fd_form_url->form_url,CancelCloseBoxCB, 0); + fl_set_form_atclose(fd_form_url->form_url, CancelCloseBoxCB, 0); } fl_set_input(fd_form_url->url_name, getContents().c_str()); fl_set_input(fd_form_url->name_name, getOptions().c_str()); diff --git a/src/insets/inseturl.h b/src/insets/inseturl.h index 9d5552f929..b73c96930a 100644 --- a/src/insets/inseturl.h +++ b/src/insets/inseturl.h @@ -1,12 +1,12 @@ // -*- C++ -*- /* This file is part of* - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright (C) 1997 LyX Team (this file was created this year) * - * ======================================================*/ + * ====================================================== */ #ifndef INSET_URL_H #define INSET_URL_H diff --git a/src/insets/lyxinset.h b/src/insets/lyxinset.h index 0e7cfce93d..7a1b9ed3b4 100644 --- a/src/insets/lyxinset.h +++ b/src/insets/lyxinset.h @@ -1,13 +1,13 @@ // -*- C++ -*- /* This file is part of - * ====================================================== + * ====================================================== * * LyX, The Document Processor * * Copyright 1995 Matthias Ettrich * Copyright 1995-1999 the LyX Team. * - * ======================================================*/ + * ====================================================== */ #ifndef LYXINSET_H #define LYXINSET_H @@ -16,7 +16,6 @@ #pragma interface #endif -#include "definitions.h" #include "gettext.h" #include "lyxfont.h" #include "lyxlex.h" @@ -28,11 +27,11 @@ struct LaTeXFeatures; /// Insets class Inset { public: - /** This is not quite the correct place for this enum, but it is - better than definitions.h. I think the correct would be to let - each subclass of Inset declare its own enum code. Actually the - notion of an Inset::Code should be avoided, but I am not sure how - this could be done in a cleaner way. */ + /** This is not quite the correct place for this enum. I think + the correct would be to let each subclass of Inset declare + its own enum code. Actually the notion of an Inset::Code + should be avoided, but I am not sure how this could be done + in a cleaner way. */ enum Code { /// NO_CODE, @@ -91,8 +90,6 @@ public: /// virtual void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x) = 0; - /// - //virtual void setBuffer(Buffer const&) {;} /// what appears in the minibuffer when opening virtual char const * EditMessage() {return _("Opened inset");} /// @@ -102,9 +99,9 @@ public: /// virtual bool AutoDelete() const; /// - virtual void Write(FILE * file)=0; + virtual void Write(FILE * file)= 0; /// - virtual void Read(LyXLex & lex)=0; + virtual void Read(LyXLex & lex)= 0; /** returns the number of rows (\n's) of generated tex code. fragile != 0 means, that the inset should take care about fragile commands by adding a \protect before. @@ -112,9 +109,9 @@ public: virtual int Latex(FILE * file, signed char fragile) = 0; virtual int Latex(string & file, signed char fragile) = 0; /// - virtual int Linuxdoc(string &/*file*/) = 0; + virtual int Linuxdoc(string & /*file*/) = 0; /// - virtual int DocBook(string &/*file*/) = 0; + virtual int DocBook(string & /*file*/) = 0; /// Updates needed features for this inset. virtual void Validate(LaTeXFeatures & features) const; ///