Get rid of trailing whitespace 'noise' in future patches for the

forseeable future.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7724 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-09-09 18:27:24 +00:00
parent d4b333e698
commit ffdb0baea3
74 changed files with 236 additions and 237 deletions

View File

@ -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<Branch> 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;

View File

@ -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);

View File

@ -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) {

View File

@ -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

View File

@ -19,7 +19,7 @@
using std::ostream;
Box::Box()
Box::Box()
: x1(0), x2(0), y1(0), y2(0)
{}

View File

@ -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

View File

@ -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();

View File

@ -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
///

View File

@ -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<ErrorItem>
{
public:
public:
ErrorList() : std::vector<ErrorItem> () {};
using std::vector<ErrorItem>::push_back;

View File

@ -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();

View File

@ -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.

View File

@ -25,7 +25,7 @@ bool ControlBranch::initialiseParams(string const & data)
InsetBranchParams params;
InsetBranchMailer::string2params(data, params);
params_.reset(new InsetBranchParams(params));
return true;
}

View File

@ -29,7 +29,7 @@ bool ControlNote::initialiseParams(string const & data)
InsetNoteParams params;
InsetNoteMailer::string2params(data, params);
params_.reset(new InsetNoteParams(params));
return true;
}

View File

@ -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 <class Inset, class Params>
void ControlInset<Inset, Params>::apply()
@ -89,5 +89,5 @@ void ControlInset<Inset, Params>::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.

View File

@ -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)

View File

@ -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)

View File

@ -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)
{

View File

@ -83,7 +83,7 @@ Glib::ustring translateMarkup(Glib::ustring const & lyxMarkup)
case IN_ITALIC:
switch (*it) {
case '\n':
state = BEGIN;
state = BEGIN;
pangoMarkup += "</i>\n";
break;
default:

View File

@ -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<Gtk::CheckMenuItem&>(
gmenu->items().back());
citem.set_active(on);

View File

@ -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<string> comp =
std::vector<string> comp =
controller_.completions(Glib::locale_from_utf8(input),
new_input_locale);
new_input = Glib::locale_to_utf8(new_input_locale);

View File

@ -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(

View File

@ -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);

View File

@ -313,7 +313,7 @@ bool GWorkArea::onKeyPress(GdkEventKey * event)
void GWorkArea::onClipboardGet(Gtk::SelectionData & /*selection_data*/,
guint /*info*/)
{
selectionRequested();
selectionRequested();
}

View File

@ -85,7 +85,7 @@ public:
const_cast<GdkWindow*>(workArea_.get_window()->gobj())); }
Glib::RefPtr<Gdk::Pixmap> getPixmap() { return workAreaPixmap_; }
Glib::RefPtr<Gdk::GC> getGC() { return workAreaGC_; }
Glib::RefPtr<Gdk::Colormap> getColormap()
Glib::RefPtr<Gdk::Colormap> getColormap()
{ return workArea_.get_colormap(); }
XftDraw * getXftDraw() { return draw_; }
ColorHandler & getColorHandler() { return colorHandler_; }

View File

@ -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());

View File

@ -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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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();

View File

@ -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();

View File

@ -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;

View File

@ -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
--------------------

View File

@ -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);

View File

@ -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)

View File

@ -49,7 +49,7 @@ private:
Display * display;
///
Colormap colormap;
///
///
std::vector<GC> colorGCcache;
///
GC getGCForeground(string const & s);

View File

@ -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);

View File

@ -26,7 +26,7 @@ public:
/// Constructor
FormBranch(Dialog &);
private:
///
///
virtual void apply();
/// Build the dialog
virtual void build();

View File

@ -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<string> vec = getVectorFromString(all_branches, "|");
for (unsigned i = 0; i < vec.size(); ++i) {

View File

@ -40,7 +40,7 @@ enum GuiColors {
GUI_COLOR_CHOICE = FL_FREE_COL15
};
}
@ -123,7 +123,7 @@ private:
///
boost::scoped_ptr<FD_document_branch> branch_;
///
boost::scoped_ptr<FormColorpicker> picker_;
boost::scoped_ptr<FormColorpicker> picker_;
///
int ActCell;
///

View File

@ -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());
}

View File

@ -26,7 +26,7 @@ public:
/// Constructor
FormNote(Dialog &);
private:
///
///
virtual void apply();
/// Build the dialog
virtual void build();

View File

@ -89,4 +89,4 @@ public:
int ypos;
};
#endif
#endif

View File

@ -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;

View File

@ -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);

View File

@ -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(); }

View File

@ -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;
}

View File

@ -110,7 +110,7 @@ public:
private:
friend class InsetIncludeMailer;
///
void write(std::ostream &) const;
///

View File

@ -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:

View File

@ -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;
}

View File

@ -72,7 +72,7 @@ public:
Box box() const { return button_box_; }
///
void setBox(Box b) { button_box_ = b; }
private:
/// The stored data.
string text_;

View File

@ -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;
}

View File

@ -44,7 +44,7 @@ struct LatexRunParams {
paragraph.
*/
bool free_spacing;
/** This var is set by the return value from BufferParams::writeLaTeX
*/
bool use_babel;

View File

@ -323,7 +323,7 @@ enum kb_action {
// 245
LFUN_INSERT_BRANCH,
LFUN_INSET_DIALOG_SHOW,
LFUN_LASTACTION // end of the table
};

View File

@ -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<string> 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
}

View File

@ -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 =

View File

@ -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 <alvaro@antalia.com>
- 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:

View File

@ -1,6 +1,6 @@
2003-09-05 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* math_kerninset.h:
* math_kerninset.h:
* math_gridinset.h: include "lyxlength.h", not "vspace.h"
* math_cursor.C: "lyxrc.h", not <lyxrc.h>
@ -38,8 +38,8 @@
2003-09-05 Angus Leeming <leeming@lyx.org>
* 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 <leeming@lyx.org>

View File

@ -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

View File

@ -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
};

View File

@ -32,7 +32,7 @@ enum Styles {
};
//
//
// This is the part common to MetricsInfo and PainterInfo
//
struct MetricsBase {

View File

@ -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<unsigned char *>( gptr());
return * reinterpret_cast<unsigned char *>( gptr());
}
int gzstreambuf::flush_buffer() {

View File

@ -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? */

View File

@ -9,7 +9,7 @@
*/
#include <config.h>
#include "support/std_sstream.h"
#include "support/std_string.h"
@ -58,4 +58,4 @@ string const tostr(string const & s)
{
return s;
}

View File

@ -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 <larsbj@gullik.net>
* texparser.C (catInit): same warning avoidance as in math_parser.C

View File

@ -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);

View File

@ -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

View File

@ -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) {

View File

@ -142,7 +142,7 @@ void handle_colalign(Parser & p, vector<ColInfo> & 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> > cellinfo(lines.size());
vector<RowInfo> 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<string> 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<ColInfo> 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 << "<cell";
if (cell.multi)
os << " multicolumn=\"" << cell.multi << "\"";
os << " alignment=\"" << verbose_align(cell.align)
os << " alignment=\"" << verbose_align(cell.align)
<< "\""
<< " valignment=\"top\"";
if (cell.topline)
@ -505,7 +505,7 @@ void handle_tabular(Parser & p, ostream & os,
}
os << "</row>\n";
}
os << "</lyxtabular>\n";
}

View File

@ -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

View File

@ -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);

View File

@ -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<string, string> 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 ");

View File

@ -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

View File

@ -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

View File

@ -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()) {