diff --git a/src/BranchList.h b/src/BranchList.h index e284aa43d0..403b3084ad 100644 --- a/src/BranchList.h +++ b/src/BranchList.h @@ -1,10 +1,10 @@ -// -*- C++ -*- +// -*- C++ -*- /** - * \file BranchList.h + * \file BranchList.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * \author Martin Vermeer - * + * * Full author contact details are available in file CREDITS. * * @@ -17,7 +17,7 @@ * A branch has a name, can either be selected or not, and uses a * user-specifyable background colour. All these can be set and * queried. - * + * * \class BranchList * * A class containing a vector of all defined branches within a @@ -43,7 +43,7 @@ public: bool getSelected() const; /// void setSelected(bool); - /// + /// string const getColor() const; /// void setColor(string const &); @@ -63,7 +63,7 @@ class BranchList { public: /// BranchList() : separator_("|") {} - + /// typedef std::list List; @@ -79,7 +79,7 @@ public: List::const_iterator end() const { return list.end(); } /// string getColor(string const &) const; - /// + /// void setColor(string const &, string const &); /// Select/deselect multiple branches given in '|'-separated string void setSelected(string const &, bool); @@ -91,11 +91,11 @@ public: bool selected(string const &) const; /// return, as a '|'-separated string, all branch names string allBranches() const; - /// + /// string allSelected() const; /// string const separator() const; - + private: /// List list; diff --git a/src/LColor.h b/src/LColor.h index 3d267e3f91..1cb2f8322a 100644 --- a/src/LColor.h +++ b/src/LColor.h @@ -42,7 +42,7 @@ * - A logical color, such as no color, inherit, math */ -class LColor +class LColor // made copyable for same reasons as LyXRC was made copyable. See there for // explanation. { @@ -183,7 +183,7 @@ public: ignore }; - + /// LColor(); /// @@ -194,11 +194,11 @@ public: void operator=(LColor const &); /// - void LColor::fill(LColor::color c, + void LColor::fill(LColor::color c, string const & lyxname, string const & x11name = string(), - string const & latexname = string(), - string const & guiname = string()); + string const & latexname = string(), + string const & guiname = string()); /// set the given LyX color to the color defined by the X11 name given void setColor(LColor::color col, string const & x11name); diff --git a/src/LaTeX.C b/src/LaTeX.C index 8f35c72b1f..a0aa2b52f9 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -227,7 +227,7 @@ int LaTeX::run(TeXErrors & terr) ++count; lyxerr[Debug::LATEX] << "Run #" << count << endl; message(runMessage(count)); - + startscript(); scanres = scanLogFile(terr); if (scanres & ERROR_RERUN) { diff --git a/src/Makefile.am b/src/Makefile.am index a399f06307..c32737d1f6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,7 +14,7 @@ EXTRA_DIST = config.h.in stamp-h.in cheaders version.C.in \ paper.h LYX_PRE_LIBS = mathed/libmathed.la insets/libinsets.la \ - frontends/libfrontends.la + frontends/libfrontends.la LYX_POST_LIBS = frontends/controllers/libcontrollers.la \ graphics/libgraphics.la \ @@ -29,12 +29,12 @@ endif OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(AIKSAURUS_LIBS) @LIBS@ -bin_PROGRAMS = lyx +bin_PROGRAMS = lyx noinst_PROGRAMS = $(FRONTENDS_PROGS) EXTRA_PROGRAMS = lyx-xforms lyx-qt lyx-gtk lyx_xforms_LDADD = $(lyx_OBJECTS) $(LYX_PRE_LIBS) \ - frontends/xforms/libxforms.la $(LYX_POST_LIBS) $(OTHERLIBS) + frontends/xforms/libxforms.la $(LYX_POST_LIBS) $(OTHERLIBS) lyx_xforms_SOURCES = main.C diff --git a/src/box.C b/src/box.C index eda92d751a..b4d8bdd5bc 100644 --- a/src/box.C +++ b/src/box.C @@ -19,7 +19,7 @@ using std::ostream; -Box::Box() +Box::Box() : x1(0), x2(0), y1(0), y2(0) {} diff --git a/src/buffer_funcs.h b/src/buffer_funcs.h index a09c44684e..24b5a5d97a 100644 --- a/src/buffer_funcs.h +++ b/src/buffer_funcs.h @@ -19,7 +19,7 @@ class TeXErrors; class ErrorList; /** - * Loads a LyX file \c filename into \c Buffer + * Loads a LyX file \c filename into \c Buffer * and \return success status. */ bool loadLyXFile(Buffer *, string const & filename); @@ -27,7 +27,7 @@ bool loadLyXFile(Buffer *, string const & filename); /* Make a new file (buffer) with name \c filename based on a template * named \c templatename */ -Buffer * newFile(string const & filename, string const & templatename, +Buffer * newFile(string const & filename, string const & templatename, bool isNamed = false); ///return the format of the buffer on a string diff --git a/src/bufferlist.C b/src/bufferlist.C index 98fba65f20..3be8b8603e 100644 --- a/src/bufferlist.C +++ b/src/bufferlist.C @@ -308,7 +308,6 @@ bool BufferList::exists(string const & s) const bool BufferList::isLoaded(Buffer const * b) const { BOOST_ASSERT(b); - BufferStorage::const_iterator cit = find(bstore.begin(), bstore.end(), b); return cit != bstore.end(); diff --git a/src/dimension.h b/src/dimension.h index f6ab891cc9..caee49d253 100644 --- a/src/dimension.h +++ b/src/dimension.h @@ -46,7 +46,7 @@ public: public: /// these are intentionally public as things like /// - /// dim.asc += 20; + /// dim.asc += 20; /// /// are used all over the place and "hiding" those behind /// diff --git a/src/errorlist.h b/src/errorlist.h index 33e57c4b3a..92e5260cf6 100644 --- a/src/errorlist.h +++ b/src/errorlist.h @@ -25,14 +25,14 @@ struct ErrorItem { int par_id; int pos_start; int pos_end; - ErrorItem(string const & error, string const & description, + ErrorItem(string const & error, string const & description, int parid, int posstart, int posend); ErrorItem(); }; class ErrorList : private std::vector { -public: +public: ErrorList() : std::vector () {}; using std::vector::push_back; diff --git a/src/frontends/Toolbar.C b/src/frontends/Toolbar.C index d7a391ee6a..d83e149af1 100644 --- a/src/frontends/Toolbar.C +++ b/src/frontends/Toolbar.C @@ -28,7 +28,7 @@ Toolbar::~Toolbar() } -void Toolbar::init() +void Toolbar::init() { // extracts the toolbars from the backend ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin(); diff --git a/src/frontends/Toolbar.h b/src/frontends/Toolbar.h index 2b12c88465..38ece3165f 100644 --- a/src/frontends/Toolbar.h +++ b/src/frontends/Toolbar.h @@ -28,7 +28,7 @@ public: /// Toolbar(); - /// + /// virtual ~Toolbar(); /// Initialize toolbar from backend @@ -57,7 +57,7 @@ private: virtual void update() = 0; /// show or hide a toolbar - virtual void displayToolbar(ToolbarBackend::Toolbar const & tb, + virtual void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show) = 0; /// Populate the layout combox. diff --git a/src/frontends/controllers/ControlBranch.C b/src/frontends/controllers/ControlBranch.C index 2b66b77bba..1d770199bc 100644 --- a/src/frontends/controllers/ControlBranch.C +++ b/src/frontends/controllers/ControlBranch.C @@ -25,7 +25,7 @@ bool ControlBranch::initialiseParams(string const & data) InsetBranchParams params; InsetBranchMailer::string2params(data, params); params_.reset(new InsetBranchParams(params)); - + return true; } diff --git a/src/frontends/controllers/ControlNote.C b/src/frontends/controllers/ControlNote.C index 21247d8557..ed9e8ab3ac 100644 --- a/src/frontends/controllers/ControlNote.C +++ b/src/frontends/controllers/ControlNote.C @@ -29,7 +29,7 @@ bool ControlNote::initialiseParams(string const & data) InsetNoteParams params; InsetNoteMailer::string2params(data, params); params_.reset(new InsetNoteParams(params)); - + return true; } diff --git a/src/frontends/controllers/README b/src/frontends/controllers/README index aa0ebd0fc4..026a2330e9 100644 --- a/src/frontends/controllers/README +++ b/src/frontends/controllers/README @@ -20,7 +20,7 @@ How the code works. =================== I'll describe Inset-type dialogs (eg, the Citation dialog). Non-inset-type -(eg the Document dialog) have similar flow, but the important controller +(eg the Document dialog) have similar flow, but the important controller functions are to be found in ControlDialogs.h, not ControlInset.h. Let's use the citation dialog as an example. @@ -31,18 +31,18 @@ The dialog is launched by : (controllers/ControlInset.h) in theControlCitation c-tor. b) request a new inset (eg from the menubar), emitting a createCitation() signal (Dialogs.h) connected to the createInset() -slot (controllers/ControlInset.h) in theControlCitation c-tor. +slot (controllers/ControlInset.h) in theControlCitation c-tor. The user presses the Ok, Apply, Cancel or Restore buttons. In xforms these are connected to the button controller (xforms/FormCitation.C: -build) so: +build) so: bc().setOK(dialog_->button_ok); bc().setApply(dialog_->button_apply); bc().setCancel(dialog_->button_cancel); bc().setRestore(dialog_->button_restore); -The button controller alters the state of the buttons (active/inactive). +The button controller alters the state of the buttons (active/inactive). xforms works by callbacks, so clicking on say the button_ok button -causes a callback event to (see FormBase.C) +causes a callback event to (see FormBase.C) extern "C" void C_FormBaseOKCB(FL_OBJECT * ob, long) { @@ -52,13 +52,13 @@ extern "C" void C_FormBaseOKCB(FL_OBJECT * ob, long) GetForm() extracts the actual instance of FormCitation that caused the event and calls OKButton() (see controllers/ViewBase.h) which in turn calls the controller's OKButton method. (The ViewBase method exists -only because : +only because : /** These shortcuts allow (e.g. xform's) global callback functions access to the buttons without making the whole controller_ public. */ So, ultimately, pressing button_ok on the Citation dialog calls -ControlBase::OKButton(). +ControlBase::OKButton(). void ControlBase::OKButton() { @@ -70,7 +70,7 @@ void ControlBase::OKButton() apply() and hide() are pure virtual methods, instantiated in ControlInset.h because the Citation dialog is an inset dialog and all -insets are functionally identical. +insets are functionally identical. template void ControlInset::apply() @@ -89,5 +89,5 @@ void ControlInset::apply() applyParamsToInset() and applyParamsNoInset(); are to be found in FormCommand.[Ch] because the citation inset is derived from InsetCommand and this subset of insets have identical internal -structure and so the params can be applied in the same way. +structure and so the params can be applied in the same way. diff --git a/src/frontends/gnome/Makefile.am b/src/frontends/gnome/Makefile.am index 02531bfc54..e7d371ab97 100644 --- a/src/frontends/gnome/Makefile.am +++ b/src/frontends/gnome/Makefile.am @@ -157,6 +157,6 @@ libgnome_la_SOURCES = \ lyx_gui.C \ gnomeTimeout.C \ gnomeTimeout.h \ - pixbutton.h + pixbutton.h libgnome.la: xforms.lo $(libgnome_la_OBJECTS) $(libgnome_la_DEPENDENCIES) diff --git a/src/frontends/gnome/README b/src/frontends/gnome/README index 322cb2e8c9..cba707aaa2 100644 --- a/src/frontends/gnome/README +++ b/src/frontends/gnome/README @@ -26,10 +26,10 @@ helper functions at the bottom of the .C file. These are automatically generated by accessors.py For accessors.py to work glade files now must adhere to the following -conventions: +conventions: * The root widget and the file should be named after the form (i.e - FormTabularCreate & FormTabularCreate.glade) + FormTabularCreate & FormTabularCreate.glade) * Functional widgets, those actually used rather than the filler widgets like Gtk::HBox etc, should have an r_ as the first two characters of their name. (see below) diff --git a/src/frontends/gtk/FileDialog.C b/src/frontends/gtk/FileDialog.C index b2fabc2db1..53494db6b8 100644 --- a/src/frontends/gtk/FileDialog.C +++ b/src/frontends/gtk/FileDialog.C @@ -36,7 +36,7 @@ FileDialog::Result const FileDialog::open(string const & path, return private_->open(path, mask, suggested); } - + FileDialog::Result const FileDialog::opendir(string const & path, string const & suggested) { diff --git a/src/frontends/gtk/GAboutlyx.C b/src/frontends/gtk/GAboutlyx.C index df6bf84ffc..be533a2a3b 100644 --- a/src/frontends/gtk/GAboutlyx.C +++ b/src/frontends/gtk/GAboutlyx.C @@ -83,7 +83,7 @@ Glib::ustring translateMarkup(Glib::ustring const & lyxMarkup) case IN_ITALIC: switch (*it) { case '\n': - state = BEGIN; + state = BEGIN; pangoMarkup += "\n"; break; default: diff --git a/src/frontends/gtk/GMenubar.C b/src/frontends/gtk/GMenubar.C index 933e20262d..3c10348960 100644 --- a/src/frontends/gtk/GMenubar.C +++ b/src/frontends/gtk/GMenubar.C @@ -184,13 +184,13 @@ void GMenubar::onSubMenuActivate(MenuItem const * item, bool on, off; on = flag.onoff(true); off = flag.onoff(false); - + if (on || off) { gmenu->items().push_back( Gtk::Menu_Helpers::CheckMenuElem( labelTrans(i->label(), i->shortcut()))); - Gtk::CheckMenuItem& citem = + Gtk::CheckMenuItem& citem = static_cast( gmenu->items().back()); citem.set_active(on); diff --git a/src/frontends/gtk/GMiniBuffer.C b/src/frontends/gtk/GMiniBuffer.C index bcc2a29e3a..436b561b17 100644 --- a/src/frontends/gtk/GMiniBuffer.C +++ b/src/frontends/gtk/GMiniBuffer.C @@ -188,7 +188,7 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event) switch (event->keyval) { case GDK_Down: { - Glib::ustring const h = + Glib::ustring const h = Glib::locale_to_utf8(controller_.historyDown()); if (h.empty()) showInfo("[End of history]", false); @@ -198,7 +198,7 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event) } case GDK_Up: { - Glib::ustring const h = + Glib::ustring const h = Glib::locale_to_utf8(controller_.historyUp()); if (h.empty()) showInfo("[Beginning of history]", false); @@ -214,7 +214,7 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event) Glib::ustring new_input, input; string new_input_locale; input = entry_.get_text(); - std::vector comp = + std::vector comp = controller_.completions(Glib::locale_from_utf8(input), new_input_locale); new_input = Glib::locale_to_utf8(new_input_locale); diff --git a/src/frontends/gtk/GToolbar.C b/src/frontends/gtk/GToolbar.C index bcdee14700..34d1981fc9 100644 --- a/src/frontends/gtk/GToolbar.C +++ b/src/frontends/gtk/GToolbar.C @@ -91,7 +91,7 @@ void GToolbar::add(ToolbarBackend::Toolbar const & tb) } -void GToolbar::add(Gtk::Toolbar * toolbar, +void GToolbar::add(Gtk::Toolbar * toolbar, int action, string const & tooltip) { @@ -114,7 +114,7 @@ void GToolbar::add(Gtk::Toolbar * toolbar, } default: { - Glib::ustring xpmName = + Glib::ustring xpmName = Glib::locale_to_utf8(toolbarbackend.getIcon(action)); Glib::ustring tip = Glib::locale_to_utf8(tooltip); if (xpmName.size() == 0) { @@ -125,7 +125,7 @@ void GToolbar::add(Gtk::Toolbar * toolbar, action), tip)); } else { - Gtk::Image * image = + Gtk::Image * image = Gtk::manage(new Gtk::Image(xpmName)); image->show(); toolbar->tools().push_back( diff --git a/src/frontends/gtk/GView.C b/src/frontends/gtk/GView.C index 22ab62d793..69fc26e07e 100644 --- a/src/frontends/gtk/GView.C +++ b/src/frontends/gtk/GView.C @@ -47,7 +47,7 @@ GView::GView() set_default_size(500, 550); // Make sure the buttons are disabled if needed. updateToolbar(); - string const iconName = + string const iconName = lyx::support::LibFileSearch("images", "lyx", "xpm"); if (!iconName.empty()) set_icon_from_file(iconName); diff --git a/src/frontends/gtk/GWorkArea.C b/src/frontends/gtk/GWorkArea.C index be647a9e2d..a407f549f8 100644 --- a/src/frontends/gtk/GWorkArea.C +++ b/src/frontends/gtk/GWorkArea.C @@ -313,7 +313,7 @@ bool GWorkArea::onKeyPress(GdkEventKey * event) void GWorkArea::onClipboardGet(Gtk::SelectionData & /*selection_data*/, guint /*info*/) { - selectionRequested(); + selectionRequested(); } diff --git a/src/frontends/gtk/GWorkArea.h b/src/frontends/gtk/GWorkArea.h index 5d12314304..63d45d4110 100644 --- a/src/frontends/gtk/GWorkArea.h +++ b/src/frontends/gtk/GWorkArea.h @@ -85,7 +85,7 @@ public: const_cast(workArea_.get_window()->gobj())); } Glib::RefPtr getPixmap() { return workAreaPixmap_; } Glib::RefPtr getGC() { return workAreaGC_; } - Glib::RefPtr getColormap() + Glib::RefPtr getColormap() { return workArea_.get_colormap(); } XftDraw * getXftDraw() { return draw_; } ColorHandler & getColorHandler() { return colorHandler_; } diff --git a/src/frontends/gtk/GtkmmX.h b/src/frontends/gtk/GtkmmX.h index 5739fb0153..ce29b39c2f 100644 --- a/src/frontends/gtk/GtkmmX.h +++ b/src/frontends/gtk/GtkmmX.h @@ -31,7 +31,7 @@ inline int getScreen() inline Window getRootWindow() { - static Window rootWin = + static Window rootWin = GDK_WINDOW_XID(Gdk::Display::get_default()-> get_default_screen()-> get_root_window()->gobj()); diff --git a/src/frontends/gtk/Makefile.am b/src/frontends/gtk/Makefile.am index 69dbc16797..41dda25ace 100644 --- a/src/frontends/gtk/Makefile.am +++ b/src/frontends/gtk/Makefile.am @@ -123,8 +123,8 @@ xforms_objects = \ ../xforms/xformsImage.lo \ ../xforms/xforms_resize.lo -# ../xforms/Dialogs.lo -# ../xforms/FormFiledialog.lo +# ../xforms/Dialogs.lo +# ../xforms/FormFiledialog.lo # ../xforms/FileDialog.lo # ../xforms/FormAboutlyx.lo diff --git a/src/frontends/gtk/lyx_gui.C b/src/frontends/gtk/lyx_gui.C index fd32a4d5ab..f23e723269 100644 --- a/src/frontends/gtk/lyx_gui.C +++ b/src/frontends/gtk/lyx_gui.C @@ -107,7 +107,7 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev) { if (xeev->error_code == BadWindow) { lyxerr << "BadWindow received !" << std::endl; lyxerr << "If you're using xforms 1.0 or greater, " - << " please report this to lyx-devel@lists.lyx.org" + << " please report this to lyx-devel@lists.lyx.org" << std::endl; return 0; } diff --git a/src/frontends/gtk/xftFontLoader.C b/src/frontends/gtk/xftFontLoader.C index 098f7a5afc..21b7a522b0 100644 --- a/src/frontends/gtk/xftFontLoader.C +++ b/src/frontends/gtk/xftFontLoader.C @@ -132,7 +132,7 @@ XftPattern * xftFontLoader::getFontPattern(LyXFont::FONT_FAMILY family, case LyXFont::BOLD_SERIES: fweight = XFT_WEIGHT_BOLD; break; - default: + default: fweight = XFT_WEIGHT_MEDIUM; break; } @@ -148,7 +148,7 @@ XftPattern * xftFontLoader::getFontPattern(LyXFont::FONT_FAMILY family, case LyXFont::SLANTED_SHAPE: fslant = XFT_SLANT_OBLIQUE; break; - default: + default: fslant = XFT_SLANT_ROMAN; break; } diff --git a/src/frontends/guiapi.C b/src/frontends/guiapi.C index 8d6922008d..1006b66fc9 100644 --- a/src/frontends/guiapi.C +++ b/src/frontends/guiapi.C @@ -21,7 +21,7 @@ void gui_show_dialog(Dialogs * d, char const * name, char const * data) { d->show(name, data, 0); } - + void gui_ShowDocument(Dialogs & d) { d.showDocument(); diff --git a/src/frontends/qt2/QGraphicsDialog.C b/src/frontends/qt2/QGraphicsDialog.C index 9032ddd567..d35c85bf46 100644 --- a/src/frontends/qt2/QGraphicsDialog.C +++ b/src/frontends/qt2/QGraphicsDialog.C @@ -81,7 +81,7 @@ void QGraphicsDialog::closeEvent(QCloseEvent * e) void QGraphicsDialog::browse_clicked() { - string const str = + string const str = form_->controller().Browse(fromqstr(filename->text())); filename->setText(toqstr(str)); form_->changed(); diff --git a/src/frontends/qt2/QWorkArea.C b/src/frontends/qt2/QWorkArea.C index 75f0e06ceb..bbfec7d533 100644 --- a/src/frontends/qt2/QWorkArea.C +++ b/src/frontends/qt2/QWorkArea.C @@ -142,7 +142,7 @@ void QWorkArea::dragEnterEvent(QDragEnterEvent * event) void QWorkArea::dropEvent(QDropEvent* event) { QStringList files; - + if (QUriDrag::decodeLocalFiles(event, files)) { lyxerr[Debug::GUI] << "QWorkArea::dropEvent: got URIs!" << endl; diff --git a/src/frontends/qt2/README b/src/frontends/qt2/README index 516cd5f996..aa7e0e485b 100644 --- a/src/frontends/qt2/README +++ b/src/frontends/qt2/README @@ -8,7 +8,7 @@ from LyX's point of view should connect its xxxChanged() signal to a the dialog's changed_adaptor() slot, which in turn should call form_->changed(). If you are using a more complicated thing anyway, then remember to call form_->changed() at the end (if it has changed !) - + Every non-trivial widget should have a tooltip. If you don't know what to write, write "FIXME", and it can fixed later. Don't be afraid to use QWhatsThis too, but this must be done in the derived class's @@ -19,17 +19,17 @@ constructor, and use _("..."). Non-trivial means that things like "OK" maintain compatibility. Remember to check tab order on a dialog (third icon, with blue bars in designer). - + Remember to check sensible resizing behaviour on a dialog. Remember to use Edit->Check Accelerators If necessary, you should override Qt2Base::isValid() for determining the validity of the current dialog's contents. - + OK/Apply/Restore/Close should be connected in the derived class's constructor to call form_->slotOK() etc. Refer to close/cancel as close in the source. - + Override update_contents() to update the dialog, not update(), and build_dialog(), not build(). Only these functions may change dialog widgets that may emit changed() during initialisation, to prevent the button controller from changing its state. @@ -39,7 +39,7 @@ should use Qt2Base::changed() in all circumstances. However, if you must call the buttoncontroller, make sure to respect Qt2Base::updating_ Don't #undef emit - #include "QtLyXView.h" instead - + Naming conventions ------------------ @@ -47,14 +47,14 @@ QFoo.[Ch] The file that interacts with the controller QFooDialog.[Ch] The implementation of the dialog, derived from the generated files ui/QFooDialog.ui The designer file ui/QFooDialogBase.[Ch] Generated files from QFooDialog.ui - + slots should be named e.g. slotFooClicked(), slotFooSelected(), where foo is the name of the widget. - + Widgets should be named like "fooXX", where XX is one of the following widget types : -CB - check box +CB - check box CO - combo box ED - line edit LA - label @@ -62,7 +62,7 @@ ML - PB - push button (FIXME: complete this) - + Stuff to be aware of -------------------- diff --git a/src/frontends/screen.h b/src/frontends/screen.h index 89cadb2428..8b8959c5f8 100644 --- a/src/frontends/screen.h +++ b/src/frontends/screen.h @@ -75,7 +75,7 @@ public: /// hide the visible cursor, if it is visible void hideCursor(); - + /// show the cursor if it is not visible void showCursor(BufferView & bv); diff --git a/src/frontends/xforms/ColorHandler.C b/src/frontends/xforms/ColorHandler.C index aa2877ef15..4b9c26e049 100644 --- a/src/frontends/xforms/ColorHandler.C +++ b/src/frontends/xforms/ColorHandler.C @@ -159,7 +159,7 @@ GC LyXColorHandler::getGCForeground(string const & s) return XCreateGC(display, drawable, GCForeground | GCFunction, &val); } - + // Gets GC according to color // Uses caching GC LyXColorHandler::getGCForeground(LColor::color c) diff --git a/src/frontends/xforms/ColorHandler.h b/src/frontends/xforms/ColorHandler.h index 1d342a0890..ba2304373d 100644 --- a/src/frontends/xforms/ColorHandler.h +++ b/src/frontends/xforms/ColorHandler.h @@ -49,7 +49,7 @@ private: Display * display; /// Colormap colormap; - /// + /// std::vector colorGCcache; /// GC getGCForeground(string const & s); diff --git a/src/frontends/xforms/FormBranch.C b/src/frontends/xforms/FormBranch.C index 5b6c68d9f7..ab1f7fd265 100644 --- a/src/frontends/xforms/FormBranch.C +++ b/src/frontends/xforms/FormBranch.C @@ -36,7 +36,7 @@ void FormBranch::build() dialog_.reset(build_branch(this)); fl_addto_choice(dialog_->choice_branch, all_branches.c_str()); - + bcview().setOK(dialog_->button_ok); bcview().setApply(dialog_->button_apply); bcview().setCancel(dialog_->button_cancel); diff --git a/src/frontends/xforms/FormBranch.h b/src/frontends/xforms/FormBranch.h index 7e3f5a350e..173f1d6aa6 100644 --- a/src/frontends/xforms/FormBranch.h +++ b/src/frontends/xforms/FormBranch.h @@ -26,7 +26,7 @@ public: /// Constructor FormBranch(Dialog &); private: - /// + /// virtual void apply(); /// Build the dialog virtual void build(); diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index ad1a99f1c7..0b13835cef 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -349,13 +349,13 @@ void FormDocument::build() bmtablefile.c_str()); picker_.reset(new FormColorpicker); - + // the document branches form branch_.reset(build_document_branch(this)); fl_set_object_color(branch_->button_color, GUI_COLOR_CHOICE, GUI_COLOR_CHOICE); - + bcview().addReadOnly(branch_->input_all_branches); bcview().addReadOnly(branch_->button_add_branch); bcview().addReadOnly(branch_->button_remove_branch); @@ -741,7 +741,7 @@ void FormDocument::branch_input(FL_OBJECT * ob) unsigned i = fl_get_browser(branch_->browser_all_branches); string const current_branch = fl_get_browser_line(branch_->browser_all_branches, i); - + RGBColor before; string x11hexname = params.branchlist().getColor(current_branch); if (x11hexname[0] == '#') { @@ -1031,7 +1031,7 @@ void FormDocument::branch_apply(BufferParams & params) branchlist_.clear(); } - + void FormDocument::UpdateClassParams(BufferParams const & params) { // These are the params that have to be updated on any class change @@ -1301,11 +1301,11 @@ void FormDocument::branch_update(BufferParams const & params) { if (!branch_.get()) return; - + string const all_branches = params.branchlist().allBranches(); fl_clear_browser(branch_->browser_all_branches); string current_branch("none"); - + if (!all_branches.empty()) { std::vector vec = getVectorFromString(all_branches, "|"); for (unsigned i = 0; i < vec.size(); ++i) { diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index fd24896fb6..3da4ac0774 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -40,7 +40,7 @@ enum GuiColors { GUI_COLOR_CHOICE = FL_FREE_COL15 }; - + } @@ -123,7 +123,7 @@ private: /// boost::scoped_ptr branch_; /// - boost::scoped_ptr picker_; + boost::scoped_ptr picker_; /// int ActCell; /// diff --git a/src/frontends/xforms/FormNote.C b/src/frontends/xforms/FormNote.C index e1a2aac4e6..c54b48a0a7 100644 --- a/src/frontends/xforms/FormNote.C +++ b/src/frontends/xforms/FormNote.C @@ -35,7 +35,7 @@ void FormNote::build() note_gui_tokens(ids_, gui_names_); - for (int i = 0; i < 3; ++i) { + for (int i = 0; i < 3; ++i) { fl_addto_choice(dialog_->choice_type, gui_names_[i].c_str()); } @@ -53,7 +53,7 @@ void FormNote::build() void FormNote::update() { string type(controller().params().type); - for (int i = 0; i < 3; ++i) { + for (int i = 0; i < 3; ++i) { if (type == ids_[i]) fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str()); } diff --git a/src/frontends/xforms/FormNote.h b/src/frontends/xforms/FormNote.h index 6d282b5762..14d9f556f0 100644 --- a/src/frontends/xforms/FormNote.h +++ b/src/frontends/xforms/FormNote.h @@ -26,7 +26,7 @@ public: /// Constructor FormNote(Dialog &); private: - /// + /// virtual void apply(); /// Build the dialog virtual void build(); diff --git a/src/frontends/xforms/XFormsToolbar.h b/src/frontends/xforms/XFormsToolbar.h index 3b62f7a778..9da0a3d774 100644 --- a/src/frontends/xforms/XFormsToolbar.h +++ b/src/frontends/xforms/XFormsToolbar.h @@ -89,4 +89,4 @@ public: int ypos; }; -#endif +#endif diff --git a/src/insets/insetbibtex.C b/src/insets/insetbibtex.C index 4ea4402abc..f87c11d3a2 100644 --- a/src/insets/insetbibtex.C +++ b/src/insets/insetbibtex.C @@ -80,7 +80,7 @@ dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd) InsetCommandMailer("bibtex", *this).showDialog(cmd.view()); return DISPATCHED; case LFUN_MOUSE_RELEASE: - if (button().box().contains(cmd.x, cmd.y)) + if (button().box().contains(cmd.x, cmd.y)) InsetCommandMailer("bibtex", *this).showDialog(cmd.view()); return DISPATCHED; diff --git a/src/insets/insetbranch.C b/src/insets/insetbranch.C index 293470f898..c01cccddb8 100644 --- a/src/insets/insetbranch.C +++ b/src/insets/insetbranch.C @@ -129,7 +129,7 @@ dispatch_result InsetBranch::localDispatch(FuncRequest const & cmd) case LFUN_INSET_EDIT: if (cmd.button() != mouse_button::button3) return InsetCollapsable::localDispatch(cmd); - + return UNDISPATCHED; case LFUN_INSET_DIALOG_UPDATE: InsetBranchMailer("branch", *this).updateDialog(bv); diff --git a/src/insets/insetcommand.h b/src/insets/insetcommand.h index 8eb2bc268b..d1b9cfecd6 100644 --- a/src/insets/insetcommand.h +++ b/src/insets/insetcommand.h @@ -68,7 +68,7 @@ public: string const & getOptions() const { return p_.getOptions(); } /// ButtonRenderer & button() const { return button_; } - + protected: /// string const getCommand() const { return p_.getCommand(); } diff --git a/src/insets/insetfloatlist.C b/src/insets/insetfloatlist.C index 4bb1c9cd45..29bfb7e99f 100644 --- a/src/insets/insetfloatlist.C +++ b/src/insets/insetfloatlist.C @@ -103,9 +103,9 @@ void InsetFloatList::metrics(MetricsInfo & mi, Dimension & dim) const { InsetCommand::metrics(mi, dim); int center_indent = (mi.base.textwidth - dim.wid) / 2; - Box b(center_indent, center_indent + dim.wid, -dim.asc, dim.des); + Box b(center_indent, center_indent + dim.wid, -dim.asc, dim.des); button().setBox(b); - + dim.wid = mi.base.textwidth; dim_ = dim; } diff --git a/src/insets/insetinclude.h b/src/insets/insetinclude.h index a444276781..9478848efd 100644 --- a/src/insets/insetinclude.h +++ b/src/insets/insetinclude.h @@ -110,7 +110,7 @@ public: private: friend class InsetIncludeMailer; - + /// void write(std::ostream &) const; /// diff --git a/src/insets/insetindex.h b/src/insets/insetindex.h index 4676ac8b24..26df595c31 100644 --- a/src/insets/insetindex.h +++ b/src/insets/insetindex.h @@ -63,7 +63,7 @@ public: /// string const getScreenLabel(Buffer const &) const; /// - void metrics(MetricsInfo &, Dimension &) const; + void metrics(MetricsInfo &, Dimension &) const; /// void draw(PainterInfo & pi, int x, int y) const; private: diff --git a/src/insets/insetnote.C b/src/insets/insetnote.C index f892aa7b0e..c0059f3f16 100644 --- a/src/insets/insetnote.C +++ b/src/insets/insetnote.C @@ -187,7 +187,7 @@ int InsetNote::latex(Buffer const & buf, ostream & os, } else if (pt == "Greyedout") { os << "%\n\\end{lyxgreyedout}\n"; i += 4; - } + } return i; } diff --git a/src/insets/renderers.h b/src/insets/renderers.h index 727e017b88..c251f88cc3 100644 --- a/src/insets/renderers.h +++ b/src/insets/renderers.h @@ -72,7 +72,7 @@ public: Box box() const { return button_box_; } /// void setBox(Box b) { button_box_ = b; } - + private: /// The stored data. string text_; diff --git a/src/kbmap.C b/src/kbmap.C index 509bf0eb4b..e68e62eb0c 100644 --- a/src/kbmap.C +++ b/src/kbmap.C @@ -90,7 +90,7 @@ keyword_item bindTags[] = { } -bool kb_keymap::read(string const & bind_file) +bool kb_keymap::read(string const & bind_file) { const int bindCount = sizeof(bindTags) / sizeof(keyword_item); @@ -101,7 +101,7 @@ bool kb_keymap::read(string const & bind_file) string const tmp = i18nLibFileSearch("bind", bind_file, "bind"); lexrc.setFile(tmp); if (!lexrc.isOK()) { - lyxerr << "kb_keymap::read: cannot open bind file:" + lyxerr << "kb_keymap::read: cannot open bind file:" << tmp << endl; return false; } @@ -120,7 +120,7 @@ bool kb_keymap::read(string const & bind_file) case BN_BIND: { string seq, cmd; - + if (lexrc.next()) { seq = lexrc.getString(); } else { @@ -128,7 +128,7 @@ bool kb_keymap::read(string const & bind_file) error = true; break; } - + if (lexrc.next(true)) { cmd = lexrc.getString(); } else { @@ -136,7 +136,7 @@ bool kb_keymap::read(string const & bind_file) error = true; break; } - + int action = lyxaction.LookupFunc(cmd); if (!action == LFUN_UNKNOWN_ACTION) { lexrc.printError("BN_BIND: Unknown LyX" @@ -144,7 +144,7 @@ bool kb_keymap::read(string const & bind_file) error = true; break; } - + bind(seq, kb_action(action)); break; } @@ -163,7 +163,7 @@ bool kb_keymap::read(string const & bind_file) } if (error) - lyxerr << "kb_keymap::read: error while reading bind file:" + lyxerr << "kb_keymap::read: error while reading bind file:" << tmp << endl; return !error; } diff --git a/src/latexrunparams.h b/src/latexrunparams.h index 35485fcfb7..a1c1296217 100644 --- a/src/latexrunparams.h +++ b/src/latexrunparams.h @@ -44,7 +44,7 @@ struct LatexRunParams { paragraph. */ bool free_spacing; - + /** This var is set by the return value from BufferParams::writeLaTeX */ bool use_babel; diff --git a/src/lfuns.h b/src/lfuns.h index 8dab45e776..4b24b321f9 100644 --- a/src/lfuns.h +++ b/src/lfuns.h @@ -323,7 +323,7 @@ enum kb_action { // 245 LFUN_INSERT_BRANCH, LFUN_INSET_DIALOG_SHOW, - + LFUN_LASTACTION // end of the table }; diff --git a/src/lyx_main.C b/src/lyx_main.C index 2f006b64a9..62861fa091 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -118,12 +118,12 @@ LyX::LyX(int & argc, char * argv[]) init(want_gui); lyxerr[Debug::INIT] << "Initializing LyX::init...done" << endl; - if (want_gui) + if (want_gui) lyx_gui::parse_lyxrc(); vector files; - for (int argi = argc - 1; argi >= 1; --argi) + for (int argi = argc - 1; argi >= 1; --argi) files.push_back(argv[argi]); if (first_start) @@ -149,7 +149,7 @@ LyX::LyX(int & argc, char * argv[]) } else { Buffer * buf = bufferlist.newBuffer(s, false); buf->error.connect(boost::bind(&LyX::printError, this, _1)); - if (loadLyXFile(buf, s)) + if (loadLyXFile(buf, s)) last_loaded = buf; else bufferlist.release(buf); @@ -163,7 +163,7 @@ LyX::LyX(int & argc, char * argv[]) QuitLyX(); exit(!success); } - } + } files.clear(); // the files are already loaded } diff --git a/src/lyxrc.C b/src/lyxrc.C index 7a4f08577a..080d731508 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -524,7 +524,7 @@ int LyXRC::read(string const & filename) default_papersize = PAPER_LEGALPAPER; else if (size == "executive") - default_papersize = + default_papersize = PAPER_EXECUTIVEPAPER; else if (size == "a3") default_papersize = diff --git a/src/mathed/BUGS b/src/mathed/BUGS index c4e263b71e..238f0e07a4 100644 --- a/src/mathed/BUGS +++ b/src/mathed/BUGS @@ -18,7 +18,7 @@ Unmarked items are known unfixed but probably unverified bugs. ---------------------------------------------------------------------- -General hints for bug reports: +General hints for bug reports: - keep the items small @@ -30,7 +30,7 @@ General hints for bug reports: - check this list regularly, comment on the marked items. - - plain ASCII text please, not much more than 70 chars per column + - plain ASCII text please, not much more than 70 chars per column Dekel: @@ -40,7 +40,7 @@ Dekel: Eran Tromer: -- When selecting, maybe give a visual indication of the "original" +- When selecting, maybe give a visual indication of the "original" anchor, when it differs from the "actual" one. Rainer Dorsch: @@ -52,7 +52,7 @@ Rainer Dorsch: it. -Marcus (Suran@gmx.net) +Marcus (Suran@gmx.net) - In math-mode I can switch back to text-mode in a formula but then I am not able to type Umlauts. @@ -62,40 +62,40 @@ Marcus (Suran@gmx.net) From: Álvaro Tejero Cantero - -- I suggest creating a different "kewybinding namespace" for the formulas, - since you could put to good use all those keybindings from the menu (M-?, - C-?) thath currently do their job PLUS getting you out of the formula. - Seriously, it'd be great to have more keys free, so M-d t would be time + +- I suggest creating a different "kewybinding namespace" for the formulas, + since you could put to good use all those keybindings from the menu (M-?, + C-?) thath currently do their job PLUS getting you out of the formula. + Seriously, it'd be great to have more keys free, so M-d t would be time derivative and M-d ? derivative with respect to the variable ?. And so on. - -- I'm no experienced C++ programmer, but if you consider it appropriate, I - could write a scritp in python for this one (I'm also very optimistic). Tell + +- I'm no experienced C++ programmer, but if you consider it appropriate, I + could write a scritp in python for this one (I'm also very optimistic). Tell me what you think: - - Flattening macros. Sometimes it's annoying the fact that once you have - written a macro, you can't touch at it's "constant parts". I call flattening + + Flattening macros. Sometimes it's annoying the fact that once you have + written a macro, you can't touch at it's "constant parts". I call flattening to the process of substituting all macros with LaTeX code. - - Task: designing a macro substitution system that reads from a file - (possibly the same file as the document's) the macros and parses the document + + Task: designing a macro substitution system that reads from a file + (possibly the same file as the document's) the macros and parses the document doing the appropriate replacements - - This is very useful, because sometimes you have a big expression in a macro - and you want to change an index only. What do you do then?. You retype - everything (perhaps several times in the document) or you create extremely - generic and parametrizable macros that aren't very fast to fill in the + + This is very useful, because sometimes you have a big expression in a macro + and you want to change an index only. What do you do then?. You retype + everything (perhaps several times in the document) or you create extremely + generic and parametrizable macros that aren't very fast to fill in the majority of cases. - - -- cut&paste inside math-mode doesn't work the X fashion (middle button doesn't + + +- cut&paste inside math-mode doesn't work the X fashion (middle button doesn't paste anything). - -- I remember having heard that a search-replace function was planned, so I - won't repeat that. Only that the flattening option would be then easier to + +- I remember having heard that a search-replace function was planned, so I + won't repeat that. Only that the flattening option would be then easier to implement on top of that. - -- Some math symbols aren't very well supported (to my knowledge). I'm + +- Some math symbols aren't very well supported (to my knowledge). I'm thinking of [] options. Jules Bean: @@ -105,14 +105,14 @@ LyX (unless it really isn't very common). b) Actions which are used frequently should be a single key-press, even if that's not very easy to remember. You learn it. c) Actions which are used rarely should be mnemonic -- easy to remember -- even if they are multiple keypresses. -Things you do rarely you care less about the time it takes to perform. +Things you do rarely you care less about the time it takes to perform. As an aside, you may think that I'm whining over nothing. However, when you enter math mode as often as I do (often more than once a sentence) it gets very annoying, especially as compared to simply typing '$' in plain emacs. Also, you may say 'why don't you just change your bindings file?'. I will ;) but I wanted to start some discussion on this since it can benefit -everyone! +everyone! More serious, though, than the number of characters which need to be typed is the confusing nature of the command. 'M-c m', typed once, puts you into @@ -122,17 +122,17 @@ into normal math-mode. IMO, 'modal' keys should either be idempotent (so hitting it the second time does nothing) or self-inverting. In fact, the inverse to 'M-c m' is either 'ESC' or simply a space typed at the end of the block --- which is confusing, since they're not of the same 'shape' as -the command that got you in there. +the command that got you in there. Now, I'm not saying that 'space' shouldn't be allowed as a short-cut to get you out of math-mode; it's a most useful and natural one, I like it a lot. -However, on balance I think M-c m should also have that effect. +However, on balance I think M-c m should also have that effect. -3) Math-mode inconsistencies +3) Math-mode inconsistencies Sometimes 'the same action' has the same keystroke both within and without math-mode. This is very sensible. However, it is very annoying when -they don't behave the way you're expecting them to. +they don't behave the way you're expecting them to. For example, 'M-c e' puts you into 'emphasise' mode. Ignoring the fact that in text mode this is italics, and in math-mode it stands for the @@ -141,31 +141,31 @@ the fact that they have the same keys. However, in math-mode, 'M-c e' is idempotent, (and you need 'M-c space' to get back into normal) whereas in text-mode 'M-c e' is self-inverse. These are the two possibilities I listed as acceptable before, but consistency would be nice ;-) IMO, self-inverse -would be best for both. +would be best for both. -5) Proposal : a 'ligatures' or 'autocorrect' system +5) Proposal : a 'ligatures' or 'autocorrect' system One of the very minor, but useful, features of TeX is the way it lets you type the nearest approximation to what you want using a 'typewriter keyboard', and substitutes the typographically neat equivalent. In particular, 'fancy' quotes (") and en and em dashes (---). I propose that this UI element could be taken up a level into LyX, with a system that does -the following (for example): +the following (for example): --> becomes \rightarrow -<- becomes \leftarrow -=> becomes \Rightarrow (etc..) -==> becomes \Longrightarrow (etc..) +-> becomes \rightarrow +<- becomes \leftarrow +=> becomes \Rightarrow (etc..) +==> becomes \Longrightarrow (etc..) This may only be appropriate in math mode, of course. This family bug me in particular because they take ages to type using a \-escape. Undoubtedly sharp minds will think of others, and also we need some way of actually -typing those sequences as literals when we want them. +typing those sequences as literals when we want them. -6) Scope macros: +6) Scope macros: The current macro system is clever, but could be neater. One improvement -I'd like is to let LyX know about TeX's scoping rules... +I'd like is to let LyX know about TeX's scoping rules... Yves Bastide: diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 4b491832bd..8825ee9aa0 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,6 +1,6 @@ 2003-09-05 Jean-Marc Lasgouttes - * math_kerninset.h: + * math_kerninset.h: * math_gridinset.h: include "lyxlength.h", not "vspace.h" * math_cursor.C: "lyxrc.h", not @@ -38,8 +38,8 @@ 2003-09-05 Angus Leeming * math_binaryopinset.[Ch]: - * math_gridinfo.h: - * math_xyarrowinset.[Ch]: + * math_gridinfo.h: + * math_xyarrowinset.[Ch]: ensure that the header file can be compiled stand-alone. 2003-09-05 Angus Leeming diff --git a/src/mathed/README b/src/mathed/README index d23b8610d5..d2ad10a309 100644 --- a/src/mathed/README +++ b/src/mathed/README @@ -3,22 +3,22 @@ Inset 'Xyz' is implemented by 'MathXyzInset' in 'math_xyzinset.[hC]' Inset hierarchy: - - MathInset + + MathInset (abstract base) / | \ Dim Char MacroArg - (thing that need (for things formerly - the width_/ascent_ known as characters) + (thing that need (for things formerly + the width_/ascent_ known as characters) /descent_ cache) - + / \ Nest Dots Func Space Symbol Bigop Noglyph - (for thing with - nested content) + (for thing with + nested content) | \ @@ -33,5 +33,5 @@ Inset hierarchy: There are only two "real LyXInsets" in here: -Formula - containing a pointer to a MathHullInset +Formula - containing a pointer to a MathHullInset FormulaMacro - containing a pointer to a MathMacroTemplate diff --git a/src/mathed/math_gridinfo.h b/src/mathed/math_gridinfo.h index 1950659a4f..8b330317a5 100644 --- a/src/mathed/math_gridinfo.h +++ b/src/mathed/math_gridinfo.h @@ -27,7 +27,7 @@ struct ColInfo struct RowInfo { - RowInfo() : topline(false), bottomline(false) {} + RowInfo() : topline(false), bottomline(false) {} bool topline; // horizontal line above int bottomline; // horizontal line below }; diff --git a/src/metricsinfo.h b/src/metricsinfo.h index 88fe44aaa3..951d5f6680 100644 --- a/src/metricsinfo.h +++ b/src/metricsinfo.h @@ -32,7 +32,7 @@ enum Styles { }; -// +// // This is the part common to MetricsInfo and PainterInfo // struct MetricsBase { diff --git a/src/support/gzstream.C b/src/support/gzstream.C index ce356c7b82..46796dbd49 100644 --- a/src/support/gzstream.C +++ b/src/support/gzstream.C @@ -18,11 +18,11 @@ // ============================================================================ // // File : gzstream.C -// Revision : $Revision: 1.1 $ -// Revision_date : $Date: 2003/07/27 23:40:08 $ +// Revision : $Revision: 1.2 $ +// Revision_date : $Date: 2003/09/09 18:27:24 $ // Author(s) : Deepak Bandyopadhyay, Lutz Kettner -// -// Standard streambuf implementation following Nicolai Josuttis, "The +// +// Standard streambuf implementation following Nicolai Josuttis, "The // Standard C++ Library". // ============================================================================ @@ -97,7 +97,7 @@ int gzstreambuf::underflow() { // used for input buffer only buffer + 4 + num); // end of buffer // return next character - return * reinterpret_cast( gptr()); + return * reinterpret_cast( gptr()); } int gzstreambuf::flush_buffer() { diff --git a/src/support/snprintf.c b/src/support/snprintf.c index cd1780af9a..7c631bec76 100644 --- a/src/support/snprintf.c +++ b/src/support/snprintf.c @@ -743,7 +743,7 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) { { precision = num_of_digits+1; precision_specified = 1; } } /* zero padding to specified precision? */ - if (num_of_digits < precision) + if (num_of_digits < precision) number_of_zeros_to_pad = precision - num_of_digits; } /* zero padding to specified minimal field width? */ diff --git a/src/support/tostr.C b/src/support/tostr.C index a6dc3fac68..5eda714f90 100644 --- a/src/support/tostr.C +++ b/src/support/tostr.C @@ -9,7 +9,7 @@ */ #include - + #include "support/std_sstream.h" #include "support/std_string.h" @@ -58,4 +58,4 @@ string const tostr(string const & s) { return s; } - + diff --git a/src/tex2lyx/ChangeLog b/src/tex2lyx/ChangeLog index 29051af599..88ebf55215 100644 --- a/src/tex2lyx/ChangeLog +++ b/src/tex2lyx/ChangeLog @@ -35,7 +35,7 @@ * context.C (begin_layout, end_layout, begin_deeper, end_deeper): tiny helper functions - (check_layout): + (check_layout): (check_end_deeper): add special handling for the case of a normal paragraph inside a list-like environment. @@ -66,14 +66,14 @@ (parse_environment): remove existing depth handling code, which is handled transparently by the Context struct; make unknown environments work (again?) through ERT - + * test-structure.tex: new test file, used to try out various layouts combinations * tex2lyx.C: * tex2lyx.h: * table.C: update to use Context struct - + * context.[Ch]: new helper struct which is passed to parse_* functions and handles *_layout and *_deeper tags output @@ -107,7 +107,7 @@ check_layout function. Remove all explicit \layout tags. (parse_text): pass an optional parameter 'layout' (handle_par): remove - + * text.C (output_command_layout): renamed from output_layout (parse_environment): new method containing a part of parse_text @@ -184,7 +184,7 @@ textclass for its existence. Also handle wide floats naturally. * tex2lyx.h: associated changes to function declarations. - + 2003-07-18 Lars Gullik Bjønnes * texparser.C (catInit): same warning avoidance as in math_parser.C diff --git a/src/tex2lyx/context.C b/src/tex2lyx/context.C index 5925ae73ab..5bc89cae13 100644 --- a/src/tex2lyx/context.C +++ b/src/tex2lyx/context.C @@ -41,7 +41,7 @@ void end_deeper(ostream & os) { os << "\n\\end_deeper \n"; } - + } Context::Context(bool need_layout_, @@ -101,9 +101,9 @@ void Context::check_layout(ostream & os) } -void Context::check_end_layout(ostream & os) +void Context::check_end_layout(ostream & os) { - if (need_end_layout) { + if (need_end_layout) { end_layout(os); need_end_layout = false; } @@ -125,7 +125,7 @@ void Context::check_deeper(ostream & os) } -void Context::check_end_deeper(ostream & os) +void Context::check_end_deeper(ostream & os) { if (need_end_deeper) { end_deeper(os); diff --git a/src/tex2lyx/context.h b/src/tex2lyx/context.h index 737c6d930c..6bf72e066e 100644 --- a/src/tex2lyx/context.h +++ b/src/tex2lyx/context.h @@ -32,7 +32,7 @@ struct Context { // Output a \end_deeper if needed void check_end_deeper(std::ostream & os); - + // dump content on stream (for debugging purpose), with // description \c desc. void dump(std::ostream &, std::string const & desc = "context") const; @@ -54,7 +54,7 @@ struct Context { // we are handling a standard paragraph in an itemize-like // environment bool deeper_paragraph; - + // The textclass of the document. Could actually be a global variable LyXTextClass const & textclass; // The layout of the current paragraph @@ -62,6 +62,6 @@ struct Context { // The layout of the outer paragraph (for environment layouts) LyXLayout_ptr parent_layout; }; - + #endif diff --git a/src/tex2lyx/math.C b/src/tex2lyx/math.C index 3ca609eabd..2c97a5bd1a 100644 --- a/src/tex2lyx/math.C +++ b/src/tex2lyx/math.C @@ -143,7 +143,7 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode) else if (t.cs() == "[") { // special handling of a few common SW user quirks p.skip_spaces(); - //if (p.next_token().cs() == + //if (p.next_token().cs() == os << "\\["; parse_math(p, os, FLAG_EQUATION, MATH_MODE); os << "\\]"; @@ -216,7 +216,7 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode) else if (t.cs() == "ss") os << "ß"; - else + else os << t.asInput(); if (flags & FLAG_LEAVE) { diff --git a/src/tex2lyx/table.C b/src/tex2lyx/table.C index 7b02cf3d79..cbbb7225b8 100644 --- a/src/tex2lyx/table.C +++ b/src/tex2lyx/table.C @@ -142,7 +142,7 @@ void handle_colalign(Parser & p, vector & colinfo) ci.special += t.character(); int const nargs = special_columns[t.character()]; for (int i = 0; i < nargs; ++i) - ci.special += "{" + p.verbatim_item() + "}"; + ci.special += "{" + p.verbatim_item() + "}"; //cerr << "handling special column '" << t << "' " << nargs // << " '" << ci.special << "'\n"; colinfo.push_back(ci); @@ -265,7 +265,7 @@ void parse_table(Parser & p, ostream & os, unsigned flags) p.error("found 'end' unexpectedly"); } - else + else os << t.asInput(); } } @@ -312,7 +312,7 @@ void handle_tabular(Parser & p, ostream & os, vector< vector > cellinfo(lines.size()); vector rowinfo(lines.size()); - + // split into rows //cerr << "// split into rows\n"; for (size_t row = 0; row < rowinfo.size(); ++row) { @@ -320,7 +320,7 @@ void handle_tabular(Parser & p, ostream & os, // init row cellinfo[row].resize(colinfo.size()); - // split row + // split row vector dummy; //cerr << "\n########### LINE: " << lines[row] << "########\n"; split(lines[row], dummy, HLINE); @@ -338,7 +338,7 @@ void handle_tabular(Parser & p, ostream & os, //cerr << "line: " << row << " below 2: " << dummy[2] << "\n"; //cerr << "line: " << row << " cells 1: " << dummy[1] << "\n"; - for (int i = 0; i <= 2; i += 2) { + for (int i = 0; i <= 2; i += 2) { //cerr << " reading from line string '" << dummy[i] << "'\n"; Parser p1(dummy[i]); while (p1.good()) { @@ -356,7 +356,7 @@ void handle_tabular(Parser & p, ostream & os, handle_hline_above(rowinfo[row], cellinfo[row]); //cerr << "above row: " << row << endl; } - } else { + } else { //cerr << "below row: " << row << endl; handle_hline_below(rowinfo[row], cellinfo[row]); } @@ -391,14 +391,14 @@ void handle_tabular(Parser & p, ostream & os, cell < cells.size() && col < colinfo.size(); ++col, ++cell) { //cerr << "cell content: '" << cells[cell] << "'\n"; Parser p(cells[cell]); - p.skip_spaces(); + p.skip_spaces(); //cells[cell] << "'\n"; if (p.next_token().cs() == "multicolumn") { // how many cells? p.get_token(); size_t const ncells = string2int(p.verbatim_item()); - // special cell properties alignment + // special cell properties alignment vector t; handle_colalign(p, t); cellinfo[row][col].multi = 1; @@ -420,7 +420,7 @@ void handle_tabular(Parser & p, ostream & os, if (t.front().rightline > 1) cellinfo[row][col + 1].leftline = true; - } else { + } else { // FLAG_END is a hack, we need to read all of it cellinfo[row][col].leftline = colinfo[col].leftline; cellinfo[row][col].rightline = colinfo[col].rightline; @@ -480,7 +480,7 @@ void handle_tabular(Parser & p, ostream & os, os << "\n"; } - + os << "\n"; } diff --git a/src/tex2lyx/test-structure.tex b/src/tex2lyx/test-structure.tex index 3b834462da..dc1ea29b23 100644 --- a/src/tex2lyx/test-structure.tex +++ b/src/tex2lyx/test-structure.tex @@ -12,9 +12,9 @@ intent is just to make sure that I can include a macro-type layout everyzhere it makes sense. A normal paragraph -\begin{equation} -x = \sin y -\end{equation} +\begin{equation} +x = \sin y +\end{equation} with maths inside it. \begin{quote} @@ -43,7 +43,7 @@ An environment \end{figure} A paragraph\footnote{hello} with a footnote and another -one\footnote{hello +one\footnote{hello there} with several paragraphs diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index dc7020aae4..3d26f373e2 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -33,7 +33,7 @@ void parse_text(Parser & p, std::ostream & os, unsigned flags, bool outer, //std::string parse_text(Parser & p, unsigned flags, const bool outer, // Context & context); -void parse_text_in_inset(Parser & p, std::ostream & os, unsigned flags, +void parse_text_in_inset(Parser & p, std::ostream & os, unsigned flags, bool outer, Context & context); diff --git a/src/tex2lyx/text.C b/src/tex2lyx/text.C index e194a3edd3..76e41b055e 100644 --- a/src/tex2lyx/text.C +++ b/src/tex2lyx/text.C @@ -136,7 +136,7 @@ string translate_len(string const & len) return len; } - + void begin_inset(ostream & os, string const & name) { os << "\n\\begin_inset " << name; @@ -190,7 +190,7 @@ private: LyXLayout_ptr findLayout(LyXTextClass const & textclass, - string const & name) + string const & name) { LyXTextClass::const_iterator it = textclass.begin(); LyXTextClass::const_iterator end = textclass.end(); @@ -209,7 +209,7 @@ void output_command_layout(ostream & os, Parser & p, bool outer, context.check_deeper(os); context.check_layout(os); if (context.layout->optionalargs > 0) { - string s; + string s; if (p.next_token().character() == '[') { p.get_token(); // eat '[' begin_inset(os, "OptArg\n"); @@ -278,7 +278,7 @@ void parse_environment(Parser & p, ostream & os, bool outer, } if (p.next_token().asInput() == "[") { height = translate_len(p.getArg('[', ']')); - + if (p.next_token().asInput() == "[") { switch(p.getArg('[', ']')[0]) { case 't': inner_pos = "0"; break; @@ -370,7 +370,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, flags |= FLAG_LEAVE; } - if (t.character() == ']' && (flags & FLAG_BRACK_LAST)) + if (t.character() == ']' && (flags & FLAG_BRACK_LAST)) return; // @@ -404,7 +404,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, // extended to other quotes, but is not so easy (a // left english quote is the same as a right german // quote...) - else if (t.asInput() == "`" + else if (t.asInput() == "`" && p.next_token().asInput() == "`") { context.check_layout(os); begin_inset(os, "Quotes "); @@ -412,8 +412,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, end_inset(os); p.get_token(); skip_braces(p); - } - else if (t.asInput() == "'" + } + else if (t.asInput() == "'" && p.next_token().asInput() == "'") { context.check_layout(os); begin_inset(os, "Quotes "); @@ -421,7 +421,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, end_inset(os); p.get_token(); skip_braces(p); - } + } else if (t.cat() == catLetter || @@ -450,14 +450,14 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, if (t.character() == '~') { if (context.layout->free_spacing) os << ' '; - else + else os << "\\InsetSpace ~\n"; } else os << t.character(); } else if (t.cat() == catBegin) { -// FIXME??? +// FIXME??? // special handling of size changes context.check_layout(os); bool const is_size = is_known(p.next_token().cs(), known_sizes); @@ -529,7 +529,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "item") { // should be done automatically by Parser::tokenize //p.skip_spaces(); - string s; + string s; if (p.next_token().character() == '[') { p.get_token(); // eat '[' Context newcontext(false, context.textclass); @@ -583,7 +583,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, else if (t.cs() == "includegraphics") { map opts = split_map(p.getArg('[', ']')); string name = p.verbatim_item(); - + context.check_layout(os); begin_inset(os, "Graphics "); os << "\n\tfilename " << name << '\n'; @@ -595,7 +595,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, << translate_len(opts["height"]) << '\n'; end_inset(os); } - + else if (t.cs() == "footnote") { context.check_layout(os); begin_inset(os, "Foot\n"); @@ -661,7 +661,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, os << name << "\n"; end_inset(os); p.get_token(); // swallow second arg - } else + } else handle_ert(os, "\\listof{" + name + "}", context); } @@ -745,7 +745,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, os << "\n\\size " << known_coded_sizes[where - known_sizes] << "\n"; } - else if (t.cs() == "LyX" || t.cs() == "TeX" + else if (t.cs() == "LyX" || t.cs() == "TeX" || t.cs() == "LaTeX") { context.check_layout(os); os << t.cs(); @@ -811,8 +811,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, skip_braces(p); } - else if (t.cs() == "_" || t.cs() == "&" || t.cs() == "#" - || t.cs() == "$" || t.cs() == "{" || t.cs() == "}" + else if (t.cs() == "_" || t.cs() == "&" || t.cs() == "#" + || t.cs() == "$" || t.cs() == "{" || t.cs() == "}" || t.cs() == "%") { context.check_layout(os); os << t.cs(); @@ -877,12 +877,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, os << "\n\\newline \n"; } } - + else if (t.cs() == "input" || t.cs() == "include" || t.cs() == "verbatiminput") { string name = '\\' + t.cs(); if (t.cs() == "verbatiminput" - && p.next_token().asInput() == "*") + && p.next_token().asInput() == "*") name += p.get_token().asInput(); context.check_layout(os); begin_inset(os, "Include "); diff --git a/src/text_funcs.h b/src/text_funcs.h index 005e44ae60..8f60fbe501 100644 --- a/src/text_funcs.h +++ b/src/text_funcs.h @@ -10,7 +10,7 @@ * Full author contact details are available in file CREDITS. * * This file contains some utility functions for actually mutating - * the text contents of a document + * the text contents of a document */ #ifndef TEXT_FUNCS_H diff --git a/src/undo.h b/src/undo.h index e494a87bc5..415377cf33 100644 --- a/src/undo.h +++ b/src/undo.h @@ -53,10 +53,10 @@ public: undo_kind kind; /** - * ID of hosting inset if the cursor is in one. + * ID of hosting inset if the cursor is in one. * if -1, then the cursor is not in an inset. * if >= 0, then the cursor is in inset with given id. - */ + */ int inset_id; /// Offset to the first paragraph in the main document paragraph list diff --git a/src/undo_funcs.C b/src/undo_funcs.C index d81a515956..14014876b5 100644 --- a/src/undo_funcs.C +++ b/src/undo_funcs.C @@ -68,8 +68,8 @@ void recordUndo(BufferView * bv, Undo::undo_kind kind, // Nobody wants all removed character appear one by one when undoing. if (! undo_finished && kind != Undo::ATOMIC) { // Check whether storing is needed. - if (! buf->undostack().empty() - && buf->undostack().top().kind == kind + if (! buf->undostack().empty() + && buf->undostack().top().kind == kind && buf->undostack().top().first_par_offset == first_offset && buf->undostack().top().last_par_offset == last_offset) { // No additonal undo recording needed - @@ -117,7 +117,7 @@ bool performUndoOrRedo(BufferView * bv, Undo & undo) advance(last, plist.size() - undo.last_par_offset); plist.erase(first, ++last); } - + // Re-insert old stuff instead { if (plist.empty()) {