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. * This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING. * Licence details can be found in the file COPYING.
* \author Martin Vermeer * \author Martin Vermeer
* *
* Full author contact details are available in file CREDITS. * 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 * A branch has a name, can either be selected or not, and uses a
* user-specifyable background colour. All these can be set and * user-specifyable background colour. All these can be set and
* queried. * queried.
* *
* \class BranchList * \class BranchList
* *
* A class containing a vector of all defined branches within a * A class containing a vector of all defined branches within a
@ -43,7 +43,7 @@ public:
bool getSelected() const; bool getSelected() const;
/// ///
void setSelected(bool); void setSelected(bool);
/// ///
string const getColor() const; string const getColor() const;
/// ///
void setColor(string const &); void setColor(string const &);
@ -63,7 +63,7 @@ class BranchList {
public: public:
/// ///
BranchList() : separator_("|") {} BranchList() : separator_("|") {}
/// ///
typedef std::list<Branch> List; typedef std::list<Branch> List;
@ -79,7 +79,7 @@ public:
List::const_iterator end() const { return list.end(); } List::const_iterator end() const { return list.end(); }
/// ///
string getColor(string const &) const; string getColor(string const &) const;
/// ///
void setColor(string const &, string const &); void setColor(string const &, string const &);
/// Select/deselect multiple branches given in '|'-separated string /// Select/deselect multiple branches given in '|'-separated string
void setSelected(string const &, bool); void setSelected(string const &, bool);
@ -91,11 +91,11 @@ public:
bool selected(string const &) const; bool selected(string const &) const;
/// return, as a '|'-separated string, all branch names /// return, as a '|'-separated string, all branch names
string allBranches() const; string allBranches() const;
/// ///
string allSelected() const; string allSelected() const;
/// ///
string const separator() const; string const separator() const;
private: private:
/// ///
List list; List list;

View File

@ -42,7 +42,7 @@
* - A logical color, such as no color, inherit, math * - 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 // made copyable for same reasons as LyXRC was made copyable. See there for
// explanation. // explanation.
{ {
@ -183,7 +183,7 @@ public:
ignore ignore
}; };
/// ///
LColor(); LColor();
/// ///
@ -194,11 +194,11 @@ public:
void operator=(LColor const &); void operator=(LColor const &);
/// ///
void LColor::fill(LColor::color c, void LColor::fill(LColor::color c,
string const & lyxname, string const & lyxname,
string const & x11name = string(), string const & x11name = string(),
string const & latexname = string(), string const & latexname = string(),
string const & guiname = string()); string const & guiname = string());
/// set the given LyX color to the color defined by the X11 name given /// set the given LyX color to the color defined by the X11 name given
void setColor(LColor::color col, string const & x11name); void setColor(LColor::color col, string const & x11name);

View File

@ -227,7 +227,7 @@ int LaTeX::run(TeXErrors & terr)
++count; ++count;
lyxerr[Debug::LATEX] << "Run #" << count << endl; lyxerr[Debug::LATEX] << "Run #" << count << endl;
message(runMessage(count)); message(runMessage(count));
startscript(); startscript();
scanres = scanLogFile(terr); scanres = scanLogFile(terr);
if (scanres & ERROR_RERUN) { if (scanres & ERROR_RERUN) {

View File

@ -14,7 +14,7 @@ EXTRA_DIST = config.h.in stamp-h.in cheaders version.C.in \
paper.h paper.h
LYX_PRE_LIBS = mathed/libmathed.la insets/libinsets.la \ LYX_PRE_LIBS = mathed/libmathed.la insets/libinsets.la \
frontends/libfrontends.la frontends/libfrontends.la
LYX_POST_LIBS = frontends/controllers/libcontrollers.la \ LYX_POST_LIBS = frontends/controllers/libcontrollers.la \
graphics/libgraphics.la \ graphics/libgraphics.la \
@ -29,12 +29,12 @@ endif
OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(AIKSAURUS_LIBS) @LIBS@ OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(AIKSAURUS_LIBS) @LIBS@
bin_PROGRAMS = lyx bin_PROGRAMS = lyx
noinst_PROGRAMS = $(FRONTENDS_PROGS) noinst_PROGRAMS = $(FRONTENDS_PROGS)
EXTRA_PROGRAMS = lyx-xforms lyx-qt lyx-gtk EXTRA_PROGRAMS = lyx-xforms lyx-qt lyx-gtk
lyx_xforms_LDADD = $(lyx_OBJECTS) $(LYX_PRE_LIBS) \ 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 lyx_xforms_SOURCES = main.C

View File

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

View File

@ -19,7 +19,7 @@ class TeXErrors;
class ErrorList; class ErrorList;
/** /**
* Loads a LyX file \c filename into \c Buffer * Loads a LyX file \c filename into \c Buffer
* and \return success status. * and \return success status.
*/ */
bool loadLyXFile(Buffer *, string const & filename); 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 /* Make a new file (buffer) with name \c filename based on a template
* named \c templatename * named \c templatename
*/ */
Buffer * newFile(string const & filename, string const & templatename, Buffer * newFile(string const & filename, string const & templatename,
bool isNamed = false); bool isNamed = false);
///return the format of the buffer on a string ///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 bool BufferList::isLoaded(Buffer const * b) const
{ {
BOOST_ASSERT(b); BOOST_ASSERT(b);
BufferStorage::const_iterator cit = BufferStorage::const_iterator cit =
find(bstore.begin(), bstore.end(), b); find(bstore.begin(), bstore.end(), b);
return cit != bstore.end(); return cit != bstore.end();

View File

@ -46,7 +46,7 @@ public:
public: public:
/// these are intentionally public as things like /// these are intentionally public as things like
/// ///
/// dim.asc += 20; /// dim.asc += 20;
/// ///
/// are used all over the place and "hiding" those behind /// are used all over the place and "hiding" those behind
/// ///

View File

@ -25,14 +25,14 @@ struct ErrorItem {
int par_id; int par_id;
int pos_start; int pos_start;
int pos_end; int pos_end;
ErrorItem(string const & error, string const & description, ErrorItem(string const & error, string const & description,
int parid, int posstart, int posend); int parid, int posstart, int posend);
ErrorItem(); ErrorItem();
}; };
class ErrorList : private std::vector<ErrorItem> class ErrorList : private std::vector<ErrorItem>
{ {
public: public:
ErrorList() : std::vector<ErrorItem> () {}; ErrorList() : std::vector<ErrorItem> () {};
using std::vector<ErrorItem>::push_back; 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 // extracts the toolbars from the backend
ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin(); ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();

View File

@ -28,7 +28,7 @@ public:
/// ///
Toolbar(); Toolbar();
/// ///
virtual ~Toolbar(); virtual ~Toolbar();
/// Initialize toolbar from backend /// Initialize toolbar from backend
@ -57,7 +57,7 @@ private:
virtual void update() = 0; virtual void update() = 0;
/// show or hide a toolbar /// show or hide a toolbar
virtual void displayToolbar(ToolbarBackend::Toolbar const & tb, virtual void displayToolbar(ToolbarBackend::Toolbar const & tb,
bool show) = 0; bool show) = 0;
/// Populate the layout combox. /// Populate the layout combox.

View File

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

View File

@ -29,7 +29,7 @@ bool ControlNote::initialiseParams(string const & data)
InsetNoteParams params; InsetNoteParams params;
InsetNoteMailer::string2params(data, params); InsetNoteMailer::string2params(data, params);
params_.reset(new InsetNoteParams(params)); params_.reset(new InsetNoteParams(params));
return true; 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 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. functions are to be found in ControlDialogs.h, not ControlInset.h.
Let's use the citation dialog as an example. 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. (controllers/ControlInset.h) in theControlCitation c-tor.
b) request a new inset (eg from the menubar), emitting a b) request a new inset (eg from the menubar), emitting a
createCitation() signal (Dialogs.h) connected to the createInset() 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 The user presses the Ok, Apply, Cancel or Restore buttons. In xforms
these are connected to the button controller (xforms/FormCitation.C: these are connected to the button controller (xforms/FormCitation.C:
build) so: build) so:
bc().setOK(dialog_->button_ok); bc().setOK(dialog_->button_ok);
bc().setApply(dialog_->button_apply); bc().setApply(dialog_->button_apply);
bc().setCancel(dialog_->button_cancel); bc().setCancel(dialog_->button_cancel);
bc().setRestore(dialog_->button_restore); 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 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) 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 GetForm() extracts the actual instance of FormCitation that caused the
event and calls OKButton() (see controllers/ViewBase.h) which in turn event and calls OKButton() (see controllers/ViewBase.h) which in turn
calls the controller's OKButton method. (The ViewBase method exists calls the controller's OKButton method. (The ViewBase method exists
only because : only because :
/** These shortcuts allow (e.g. xform's) global callback functions /** These shortcuts allow (e.g. xform's) global callback functions
access to the buttons without making the whole controller_ access to the buttons without making the whole controller_
public. */ public. */
So, ultimately, pressing button_ok on the Citation dialog calls So, ultimately, pressing button_ok on the Citation dialog calls
ControlBase::OKButton(). ControlBase::OKButton().
void ControlBase::OKButton() void ControlBase::OKButton()
{ {
@ -70,7 +70,7 @@ void ControlBase::OKButton()
apply() and hide() are pure virtual methods, instantiated in apply() and hide() are pure virtual methods, instantiated in
ControlInset.h because the Citation dialog is an inset dialog and all 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> template <class Inset, class Params>
void ControlInset<Inset, Params>::apply() void ControlInset<Inset, Params>::apply()
@ -89,5 +89,5 @@ void ControlInset<Inset, Params>::apply()
applyParamsToInset() and applyParamsNoInset(); are to be found in applyParamsToInset() and applyParamsNoInset(); are to be found in
FormCommand.[Ch] because the citation inset is derived from FormCommand.[Ch] because the citation inset is derived from
InsetCommand and this subset of insets have identical internal 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 \ lyx_gui.C \
gnomeTimeout.C \ gnomeTimeout.C \
gnomeTimeout.h \ gnomeTimeout.h \
pixbutton.h pixbutton.h
libgnome.la: xforms.lo $(libgnome_la_OBJECTS) $(libgnome_la_DEPENDENCIES) 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 automatically generated by accessors.py
For accessors.py to work glade files now must adhere to the following 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 * 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 * Functional widgets, those actually used rather than the filler
widgets like Gtk::HBox etc, should have an r_ as the first two widgets like Gtk::HBox etc, should have an r_ as the first two
characters of their name. (see below) 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); return private_->open(path, mask, suggested);
} }
FileDialog::Result const FileDialog::opendir(string const & path, FileDialog::Result const FileDialog::opendir(string const & path,
string const & suggested) string const & suggested)
{ {

View File

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

View File

@ -184,13 +184,13 @@ void GMenubar::onSubMenuActivate(MenuItem const * item,
bool on, off; bool on, off;
on = flag.onoff(true); on = flag.onoff(true);
off = flag.onoff(false); off = flag.onoff(false);
if (on || off) { if (on || off) {
gmenu->items().push_back( gmenu->items().push_back(
Gtk::Menu_Helpers::CheckMenuElem( Gtk::Menu_Helpers::CheckMenuElem(
labelTrans(i->label(), labelTrans(i->label(),
i->shortcut()))); i->shortcut())));
Gtk::CheckMenuItem& citem = Gtk::CheckMenuItem& citem =
static_cast<Gtk::CheckMenuItem&>( static_cast<Gtk::CheckMenuItem&>(
gmenu->items().back()); gmenu->items().back());
citem.set_active(on); citem.set_active(on);

View File

@ -188,7 +188,7 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event)
switch (event->keyval) { switch (event->keyval) {
case GDK_Down: case GDK_Down:
{ {
Glib::ustring const h = Glib::ustring const h =
Glib::locale_to_utf8(controller_.historyDown()); Glib::locale_to_utf8(controller_.historyDown());
if (h.empty()) if (h.empty())
showInfo("[End of history]", false); showInfo("[End of history]", false);
@ -198,7 +198,7 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event)
} }
case GDK_Up: case GDK_Up:
{ {
Glib::ustring const h = Glib::ustring const h =
Glib::locale_to_utf8(controller_.historyUp()); Glib::locale_to_utf8(controller_.historyUp());
if (h.empty()) if (h.empty())
showInfo("[Beginning of history]", false); showInfo("[Beginning of history]", false);
@ -214,7 +214,7 @@ bool GMiniBuffer::onKeyPress(GdkEventKey * event)
Glib::ustring new_input, input; Glib::ustring new_input, input;
string new_input_locale; string new_input_locale;
input = entry_.get_text(); input = entry_.get_text();
std::vector<string> comp = std::vector<string> comp =
controller_.completions(Glib::locale_from_utf8(input), controller_.completions(Glib::locale_from_utf8(input),
new_input_locale); new_input_locale);
new_input = Glib::locale_to_utf8(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, int action,
string const & tooltip) string const & tooltip)
{ {
@ -114,7 +114,7 @@ void GToolbar::add(Gtk::Toolbar * toolbar,
} }
default: default:
{ {
Glib::ustring xpmName = Glib::ustring xpmName =
Glib::locale_to_utf8(toolbarbackend.getIcon(action)); Glib::locale_to_utf8(toolbarbackend.getIcon(action));
Glib::ustring tip = Glib::locale_to_utf8(tooltip); Glib::ustring tip = Glib::locale_to_utf8(tooltip);
if (xpmName.size() == 0) { if (xpmName.size() == 0) {
@ -125,7 +125,7 @@ void GToolbar::add(Gtk::Toolbar * toolbar,
action), action),
tip)); tip));
} else { } else {
Gtk::Image * image = Gtk::Image * image =
Gtk::manage(new Gtk::Image(xpmName)); Gtk::manage(new Gtk::Image(xpmName));
image->show(); image->show();
toolbar->tools().push_back( toolbar->tools().push_back(

View File

@ -47,7 +47,7 @@ GView::GView()
set_default_size(500, 550); set_default_size(500, 550);
// Make sure the buttons are disabled if needed. // Make sure the buttons are disabled if needed.
updateToolbar(); updateToolbar();
string const iconName = string const iconName =
lyx::support::LibFileSearch("images", "lyx", "xpm"); lyx::support::LibFileSearch("images", "lyx", "xpm");
if (!iconName.empty()) if (!iconName.empty())
set_icon_from_file(iconName); set_icon_from_file(iconName);

View File

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

View File

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

View File

@ -31,7 +31,7 @@ inline int getScreen()
inline Window getRootWindow() inline Window getRootWindow()
{ {
static Window rootWin = static Window rootWin =
GDK_WINDOW_XID(Gdk::Display::get_default()-> GDK_WINDOW_XID(Gdk::Display::get_default()->
get_default_screen()-> get_default_screen()->
get_root_window()->gobj()); get_root_window()->gobj());

View File

@ -123,8 +123,8 @@ xforms_objects = \
../xforms/xformsImage.lo \ ../xforms/xformsImage.lo \
../xforms/xforms_resize.lo ../xforms/xforms_resize.lo
# ../xforms/Dialogs.lo # ../xforms/Dialogs.lo
# ../xforms/FormFiledialog.lo # ../xforms/FormFiledialog.lo
# ../xforms/FileDialog.lo # ../xforms/FileDialog.lo
# ../xforms/FormAboutlyx.lo # ../xforms/FormAboutlyx.lo

View File

@ -107,7 +107,7 @@ int LyX_XErrHandler(Display * display, XErrorEvent * xeev) {
if (xeev->error_code == BadWindow) { if (xeev->error_code == BadWindow) {
lyxerr << "BadWindow received !" << std::endl; lyxerr << "BadWindow received !" << std::endl;
lyxerr << "If you're using xforms 1.0 or greater, " 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; << std::endl;
return 0; return 0;
} }

View File

@ -132,7 +132,7 @@ XftPattern * xftFontLoader::getFontPattern(LyXFont::FONT_FAMILY family,
case LyXFont::BOLD_SERIES: case LyXFont::BOLD_SERIES:
fweight = XFT_WEIGHT_BOLD; fweight = XFT_WEIGHT_BOLD;
break; break;
default: default:
fweight = XFT_WEIGHT_MEDIUM; fweight = XFT_WEIGHT_MEDIUM;
break; break;
} }
@ -148,7 +148,7 @@ XftPattern * xftFontLoader::getFontPattern(LyXFont::FONT_FAMILY family,
case LyXFont::SLANTED_SHAPE: case LyXFont::SLANTED_SHAPE:
fslant = XFT_SLANT_OBLIQUE; fslant = XFT_SLANT_OBLIQUE;
break; break;
default: default:
fslant = XFT_SLANT_ROMAN; fslant = XFT_SLANT_ROMAN;
break; break;
} }

View File

@ -21,7 +21,7 @@ void gui_show_dialog(Dialogs * d, char const * name, char const * data)
{ {
d->show(name, data, 0); d->show(name, data, 0);
} }
void gui_ShowDocument(Dialogs & d) void gui_ShowDocument(Dialogs & d)
{ {
d.showDocument(); d.showDocument();

View File

@ -81,7 +81,7 @@ void QGraphicsDialog::closeEvent(QCloseEvent * e)
void QGraphicsDialog::browse_clicked() void QGraphicsDialog::browse_clicked()
{ {
string const str = string const str =
form_->controller().Browse(fromqstr(filename->text())); form_->controller().Browse(fromqstr(filename->text()));
filename->setText(toqstr(str)); filename->setText(toqstr(str));
form_->changed(); form_->changed();

View File

@ -142,7 +142,7 @@ void QWorkArea::dragEnterEvent(QDragEnterEvent * event)
void QWorkArea::dropEvent(QDropEvent* event) void QWorkArea::dropEvent(QDropEvent* event)
{ {
QStringList files; QStringList files;
if (QUriDrag::decodeLocalFiles(event, files)) { if (QUriDrag::decodeLocalFiles(event, files)) {
lyxerr[Debug::GUI] << "QWorkArea::dropEvent: got URIs!" lyxerr[Debug::GUI] << "QWorkArea::dropEvent: got URIs!"
<< endl; << 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 a the dialog's changed_adaptor() slot, which in turn should call
form_->changed(). If you are using a more complicated thing anyway, form_->changed(). If you are using a more complicated thing anyway,
then remember to call form_->changed() at the end (if it has changed !) 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 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 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 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. maintain compatibility.
Remember to check tab order on a dialog (third icon, with blue bars in designer). 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 check sensible resizing behaviour on a dialog.
Remember to use Edit->Check Accelerators Remember to use Edit->Check Accelerators
If necessary, you should override Qt2Base::isValid() for determining the validity If necessary, you should override Qt2Base::isValid() for determining the validity
of the current dialog's contents. of the current dialog's contents.
OK/Apply/Restore/Close should be connected in the derived class's constructor 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. 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(), 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() not build(). Only these functions may change dialog widgets that may emit changed()
during initialisation, to prevent the button controller from changing its state. 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_ the buttoncontroller, make sure to respect Qt2Base::updating_
Don't #undef emit - #include "QtLyXView.h" instead Don't #undef emit - #include "QtLyXView.h" instead
Naming conventions 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 QFooDialog.[Ch] The implementation of the dialog, derived from the generated files
ui/QFooDialog.ui The designer file ui/QFooDialog.ui The designer file
ui/QFooDialogBase.[Ch] Generated files from QFooDialog.ui ui/QFooDialogBase.[Ch] Generated files from QFooDialog.ui
slots should be named e.g. slotFooClicked(), slotFooSelected(), where foo is the name slots should be named e.g. slotFooClicked(), slotFooSelected(), where foo is the name
of the widget. of the widget.
Widgets should be named like "fooXX", where XX is one of the following Widgets should be named like "fooXX", where XX is one of the following
widget types : widget types :
CB - check box CB - check box
CO - combo box CO - combo box
ED - line edit ED - line edit
LA - label LA - label
@ -62,7 +62,7 @@ ML -
PB - push button PB - push button
(FIXME: complete this) (FIXME: complete this)
Stuff to be aware of Stuff to be aware of
-------------------- --------------------

View File

@ -75,7 +75,7 @@ public:
/// hide the visible cursor, if it is visible /// hide the visible cursor, if it is visible
void hideCursor(); void hideCursor();
/// show the cursor if it is not visible /// show the cursor if it is not visible
void showCursor(BufferView & bv); void showCursor(BufferView & bv);

View File

@ -159,7 +159,7 @@ GC LyXColorHandler::getGCForeground(string const & s)
return XCreateGC(display, drawable, return XCreateGC(display, drawable,
GCForeground | GCFunction, &val); GCForeground | GCFunction, &val);
} }
// Gets GC according to color // Gets GC according to color
// Uses caching // Uses caching
GC LyXColorHandler::getGCForeground(LColor::color c) GC LyXColorHandler::getGCForeground(LColor::color c)

View File

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

View File

@ -36,7 +36,7 @@ void FormBranch::build()
dialog_.reset(build_branch(this)); dialog_.reset(build_branch(this));
fl_addto_choice(dialog_->choice_branch, all_branches.c_str()); fl_addto_choice(dialog_->choice_branch, all_branches.c_str());
bcview().setOK(dialog_->button_ok); bcview().setOK(dialog_->button_ok);
bcview().setApply(dialog_->button_apply); bcview().setApply(dialog_->button_apply);
bcview().setCancel(dialog_->button_cancel); bcview().setCancel(dialog_->button_cancel);

View File

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

View File

@ -349,13 +349,13 @@ void FormDocument::build()
bmtablefile.c_str()); bmtablefile.c_str());
picker_.reset(new FormColorpicker); picker_.reset(new FormColorpicker);
// the document branches form // the document branches form
branch_.reset(build_document_branch(this)); branch_.reset(build_document_branch(this));
fl_set_object_color(branch_->button_color, fl_set_object_color(branch_->button_color,
GUI_COLOR_CHOICE, GUI_COLOR_CHOICE); GUI_COLOR_CHOICE, GUI_COLOR_CHOICE);
bcview().addReadOnly(branch_->input_all_branches); bcview().addReadOnly(branch_->input_all_branches);
bcview().addReadOnly(branch_->button_add_branch); bcview().addReadOnly(branch_->button_add_branch);
bcview().addReadOnly(branch_->button_remove_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); unsigned i = fl_get_browser(branch_->browser_all_branches);
string const current_branch = string const current_branch =
fl_get_browser_line(branch_->browser_all_branches, i); fl_get_browser_line(branch_->browser_all_branches, i);
RGBColor before; RGBColor before;
string x11hexname = params.branchlist().getColor(current_branch); string x11hexname = params.branchlist().getColor(current_branch);
if (x11hexname[0] == '#') { if (x11hexname[0] == '#') {
@ -1031,7 +1031,7 @@ void FormDocument::branch_apply(BufferParams & params)
branchlist_.clear(); branchlist_.clear();
} }
void FormDocument::UpdateClassParams(BufferParams const & params) void FormDocument::UpdateClassParams(BufferParams const & params)
{ {
// These are the params that have to be updated on any class change // 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()) if (!branch_.get())
return; return;
string const all_branches = params.branchlist().allBranches(); string const all_branches = params.branchlist().allBranches();
fl_clear_browser(branch_->browser_all_branches); fl_clear_browser(branch_->browser_all_branches);
string current_branch("none"); string current_branch("none");
if (!all_branches.empty()) { if (!all_branches.empty()) {
std::vector<string> vec = getVectorFromString(all_branches, "|"); std::vector<string> vec = getVectorFromString(all_branches, "|");
for (unsigned i = 0; i < vec.size(); ++i) { for (unsigned i = 0; i < vec.size(); ++i) {

View File

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

View File

@ -35,7 +35,7 @@ void FormNote::build()
note_gui_tokens(ids_, gui_names_); 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()); fl_addto_choice(dialog_->choice_type, gui_names_[i].c_str());
} }
@ -53,7 +53,7 @@ void FormNote::build()
void FormNote::update() void FormNote::update()
{ {
string type(controller().params().type); string type(controller().params().type);
for (int i = 0; i < 3; ++i) { for (int i = 0; i < 3; ++i) {
if (type == ids_[i]) if (type == ids_[i])
fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str()); fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str());
} }

View File

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

View File

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

View File

@ -80,7 +80,7 @@ dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd)
InsetCommandMailer("bibtex", *this).showDialog(cmd.view()); InsetCommandMailer("bibtex", *this).showDialog(cmd.view());
return DISPATCHED; return DISPATCHED;
case LFUN_MOUSE_RELEASE: 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()); InsetCommandMailer("bibtex", *this).showDialog(cmd.view());
return DISPATCHED; return DISPATCHED;

View File

@ -129,7 +129,7 @@ dispatch_result InsetBranch::localDispatch(FuncRequest const & cmd)
case LFUN_INSET_EDIT: case LFUN_INSET_EDIT:
if (cmd.button() != mouse_button::button3) if (cmd.button() != mouse_button::button3)
return InsetCollapsable::localDispatch(cmd); return InsetCollapsable::localDispatch(cmd);
return UNDISPATCHED; return UNDISPATCHED;
case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_DIALOG_UPDATE:
InsetBranchMailer("branch", *this).updateDialog(bv); InsetBranchMailer("branch", *this).updateDialog(bv);

View File

@ -68,7 +68,7 @@ public:
string const & getOptions() const { return p_.getOptions(); } string const & getOptions() const { return p_.getOptions(); }
/// ///
ButtonRenderer & button() const { return button_; } ButtonRenderer & button() const { return button_; }
protected: protected:
/// ///
string const getCommand() const { return p_.getCommand(); } 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); InsetCommand::metrics(mi, dim);
int center_indent = (mi.base.textwidth - dim.wid) / 2; 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); button().setBox(b);
dim.wid = mi.base.textwidth; dim.wid = mi.base.textwidth;
dim_ = dim; dim_ = dim;
} }

View File

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

View File

@ -63,7 +63,7 @@ public:
/// ///
string const getScreenLabel(Buffer const &) const; 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; void draw(PainterInfo & pi, int x, int y) const;
private: private:

View File

@ -187,7 +187,7 @@ int InsetNote::latex(Buffer const & buf, ostream & os,
} else if (pt == "Greyedout") { } else if (pt == "Greyedout") {
os << "%\n\\end{lyxgreyedout}\n"; os << "%\n\\end{lyxgreyedout}\n";
i += 4; i += 4;
} }
return i; return i;
} }

View File

@ -72,7 +72,7 @@ public:
Box box() const { return button_box_; } Box box() const { return button_box_; }
/// ///
void setBox(Box b) { button_box_ = b; } void setBox(Box b) { button_box_ = b; }
private: private:
/// The stored data. /// The stored data.
string text_; 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); 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"); string const tmp = i18nLibFileSearch("bind", bind_file, "bind");
lexrc.setFile(tmp); lexrc.setFile(tmp);
if (!lexrc.isOK()) { if (!lexrc.isOK()) {
lyxerr << "kb_keymap::read: cannot open bind file:" lyxerr << "kb_keymap::read: cannot open bind file:"
<< tmp << endl; << tmp << endl;
return false; return false;
} }
@ -120,7 +120,7 @@ bool kb_keymap::read(string const & bind_file)
case BN_BIND: case BN_BIND:
{ {
string seq, cmd; string seq, cmd;
if (lexrc.next()) { if (lexrc.next()) {
seq = lexrc.getString(); seq = lexrc.getString();
} else { } else {
@ -128,7 +128,7 @@ bool kb_keymap::read(string const & bind_file)
error = true; error = true;
break; break;
} }
if (lexrc.next(true)) { if (lexrc.next(true)) {
cmd = lexrc.getString(); cmd = lexrc.getString();
} else { } else {
@ -136,7 +136,7 @@ bool kb_keymap::read(string const & bind_file)
error = true; error = true;
break; break;
} }
int action = lyxaction.LookupFunc(cmd); int action = lyxaction.LookupFunc(cmd);
if (!action == LFUN_UNKNOWN_ACTION) { if (!action == LFUN_UNKNOWN_ACTION) {
lexrc.printError("BN_BIND: Unknown LyX" lexrc.printError("BN_BIND: Unknown LyX"
@ -144,7 +144,7 @@ bool kb_keymap::read(string const & bind_file)
error = true; error = true;
break; break;
} }
bind(seq, kb_action(action)); bind(seq, kb_action(action));
break; break;
} }
@ -163,7 +163,7 @@ bool kb_keymap::read(string const & bind_file)
} }
if (error) if (error)
lyxerr << "kb_keymap::read: error while reading bind file:" lyxerr << "kb_keymap::read: error while reading bind file:"
<< tmp << endl; << tmp << endl;
return !error; return !error;
} }

View File

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

View File

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

View File

@ -118,12 +118,12 @@ LyX::LyX(int & argc, char * argv[])
init(want_gui); init(want_gui);
lyxerr[Debug::INIT] << "Initializing LyX::init...done" << endl; lyxerr[Debug::INIT] << "Initializing LyX::init...done" << endl;
if (want_gui) if (want_gui)
lyx_gui::parse_lyxrc(); lyx_gui::parse_lyxrc();
vector<string> files; vector<string> files;
for (int argi = argc - 1; argi >= 1; --argi) for (int argi = argc - 1; argi >= 1; --argi)
files.push_back(argv[argi]); files.push_back(argv[argi]);
if (first_start) if (first_start)
@ -149,7 +149,7 @@ LyX::LyX(int & argc, char * argv[])
} else { } else {
Buffer * buf = bufferlist.newBuffer(s, false); Buffer * buf = bufferlist.newBuffer(s, false);
buf->error.connect(boost::bind(&LyX::printError, this, _1)); buf->error.connect(boost::bind(&LyX::printError, this, _1));
if (loadLyXFile(buf, s)) if (loadLyXFile(buf, s))
last_loaded = buf; last_loaded = buf;
else else
bufferlist.release(buf); bufferlist.release(buf);
@ -163,7 +163,7 @@ LyX::LyX(int & argc, char * argv[])
QuitLyX(); QuitLyX();
exit(!success); exit(!success);
} }
} }
files.clear(); // the files are already loaded files.clear(); // the files are already loaded
} }

View File

@ -524,7 +524,7 @@ int LyXRC::read(string const & filename)
default_papersize = default_papersize =
PAPER_LEGALPAPER; PAPER_LEGALPAPER;
else if (size == "executive") else if (size == "executive")
default_papersize = default_papersize =
PAPER_EXECUTIVEPAPER; PAPER_EXECUTIVEPAPER;
else if (size == "a3") else if (size == "a3")
default_papersize = 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 - keep the items small
@ -30,7 +30,7 @@ General hints for bug reports:
- check this list regularly, comment on the marked items. - 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: Dekel:
@ -40,7 +40,7 @@ Dekel:
Eran Tromer: 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. anchor, when it differs from the "actual" one.
Rainer Dorsch: Rainer Dorsch:
@ -52,7 +52,7 @@ Rainer Dorsch:
it. 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 - In math-mode I can switch back to text-mode in a formula but then I am
not able to type Umlauts. not able to type Umlauts.
@ -62,40 +62,40 @@ Marcus (Suran@gmx.net)
From: Álvaro Tejero Cantero <alvaro@antalia.com> From: Álvaro Tejero Cantero <alvaro@antalia.com>
- I suggest creating a different "kewybinding namespace" for the formulas, - I suggest creating a different "kewybinding namespace" for the formulas,
since you could put to good use all those keybindings from the menu (M-?, 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. 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 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. 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 - 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 could write a scritp in python for this one (I'm also very optimistic). Tell
me what you think: me what you think:
Flattening macros. Sometimes it's annoying the fact that once you have 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 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. to the process of substituting all macros with LaTeX code.
Task: designing a macro substitution system that reads from a file 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 (possibly the same file as the document's) the macros and parses the document
doing the appropriate replacements doing the appropriate replacements
This is very useful, because sometimes you have a big expression in a macro 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 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 everything (perhaps several times in the document) or you create extremely
generic and parametrizable macros that aren't very fast to fill in the generic and parametrizable macros that aren't very fast to fill in the
majority of cases. 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). paste anything).
- I remember having heard that a search-replace function was planned, so I - 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 won't repeat that. Only that the flattening option would be then easier to
implement on top of that. 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. thinking of [] options.
Jules Bean: 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 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 remember. You learn it. c) Actions which are used rarely should be
mnemonic -- easy to remember -- even if they are multiple keypresses. 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 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 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 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 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 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 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 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 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 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 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 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. 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 Sometimes 'the same action' has the same keystroke both within and
without math-mode. This is very sensible. However, it is very annoying when 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 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 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 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 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 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 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 type the nearest approximation to what you want using a 'typewriter
keyboard', and substitutes the typographically neat equivalent. In keyboard', and substitutes the typographically neat equivalent. In
particular, 'fancy' quotes (") and en and em dashes (---). I propose that 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 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 \rightarrow
<- becomes \leftarrow <- becomes \leftarrow
=> becomes \Rightarrow (etc..) => becomes \Rightarrow (etc..)
==> becomes \Longrightarrow (etc..) ==> becomes \Longrightarrow (etc..)
This may only be appropriate in math mode, of course. This family bug me 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 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 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 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: Yves Bastide:

View File

@ -1,6 +1,6 @@
2003-09-05 Jean-Marc Lasgouttes <lasgouttes@lyx.org> 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_gridinset.h: include "lyxlength.h", not "vspace.h"
* math_cursor.C: "lyxrc.h", not <lyxrc.h> * math_cursor.C: "lyxrc.h", not <lyxrc.h>
@ -38,8 +38,8 @@
2003-09-05 Angus Leeming <leeming@lyx.org> 2003-09-05 Angus Leeming <leeming@lyx.org>
* math_binaryopinset.[Ch]: * math_binaryopinset.[Ch]:
* math_gridinfo.h: * math_gridinfo.h:
* math_xyarrowinset.[Ch]: * math_xyarrowinset.[Ch]:
ensure that the header file can be compiled stand-alone. ensure that the header file can be compiled stand-alone.
2003-09-05 Angus Leeming <leeming@lyx.org> 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: Inset hierarchy:
MathInset MathInset
(abstract base) (abstract base)
/ | \ / | \
Dim Char MacroArg Dim Char MacroArg
(thing that need (for things formerly (thing that need (for things formerly
the width_/ascent_ known as characters) the width_/ascent_ known as characters)
/descent_ cache) /descent_ cache)
/ \ / \
Nest Dots Func Space Symbol Bigop Noglyph Nest Dots Func Space Symbol Bigop Noglyph
(for thing with (for thing with
nested content) nested content)
| \ | \
@ -33,5 +33,5 @@ Inset hierarchy:
There are only two "real LyXInsets" in here: 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 FormulaMacro - containing a pointer to a MathMacroTemplate

View File

@ -27,7 +27,7 @@ struct ColInfo
struct RowInfo struct RowInfo
{ {
RowInfo() : topline(false), bottomline(false) {} RowInfo() : topline(false), bottomline(false) {}
bool topline; // horizontal line above bool topline; // horizontal line above
int bottomline; // horizontal line below int bottomline; // horizontal line below
}; };

View File

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

View File

@ -18,11 +18,11 @@
// ============================================================================ // ============================================================================
// //
// File : gzstream.C // File : gzstream.C
// Revision : $Revision: 1.1 $ // Revision : $Revision: 1.2 $
// Revision_date : $Date: 2003/07/27 23:40:08 $ // Revision_date : $Date: 2003/09/09 18:27:24 $
// Author(s) : Deepak Bandyopadhyay, Lutz Kettner // Author(s) : Deepak Bandyopadhyay, Lutz Kettner
// //
// Standard streambuf implementation following Nicolai Josuttis, "The // Standard streambuf implementation following Nicolai Josuttis, "The
// Standard C++ Library". // Standard C++ Library".
// ============================================================================ // ============================================================================
@ -97,7 +97,7 @@ int gzstreambuf::underflow() { // used for input buffer only
buffer + 4 + num); // end of buffer buffer + 4 + num); // end of buffer
// return next character // return next character
return * reinterpret_cast<unsigned char *>( gptr()); return * reinterpret_cast<unsigned char *>( gptr());
} }
int gzstreambuf::flush_buffer() { 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; } { precision = num_of_digits+1; precision_specified = 1; }
} }
/* zero padding to specified precision? */ /* zero padding to specified precision? */
if (num_of_digits < precision) if (num_of_digits < precision)
number_of_zeros_to_pad = precision - num_of_digits; number_of_zeros_to_pad = precision - num_of_digits;
} }
/* zero padding to specified minimal field width? */ /* zero padding to specified minimal field width? */

View File

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

View File

@ -35,7 +35,7 @@
* context.C (begin_layout, end_layout, begin_deeper, end_deeper): * context.C (begin_layout, end_layout, begin_deeper, end_deeper):
tiny helper functions tiny helper functions
(check_layout): (check_layout):
(check_end_deeper): add special handling for the case of a normal (check_end_deeper): add special handling for the case of a normal
paragraph inside a list-like environment. paragraph inside a list-like environment.
@ -66,14 +66,14 @@
(parse_environment): remove existing depth handling code, which is (parse_environment): remove existing depth handling code, which is
handled transparently by the Context struct; make unknown handled transparently by the Context struct; make unknown
environments work (again?) through ERT environments work (again?) through ERT
* test-structure.tex: new test file, used to try out various * test-structure.tex: new test file, used to try out various
layouts combinations layouts combinations
* tex2lyx.C: * tex2lyx.C:
* tex2lyx.h: * tex2lyx.h:
* table.C: update to use Context struct * table.C: update to use Context struct
* context.[Ch]: new helper struct which is passed to parse_* * context.[Ch]: new helper struct which is passed to parse_*
functions and handles *_layout and *_deeper tags output functions and handles *_layout and *_deeper tags output
@ -107,7 +107,7 @@
check_layout function. Remove all explicit \layout tags. check_layout function. Remove all explicit \layout tags.
(parse_text): pass an optional parameter 'layout' (parse_text): pass an optional parameter 'layout'
(handle_par): remove (handle_par): remove
* text.C (output_command_layout): renamed from output_layout * text.C (output_command_layout): renamed from output_layout
(parse_environment): new method containing a part of parse_text (parse_environment): new method containing a part of parse_text
@ -184,7 +184,7 @@
textclass for its existence. Also handle wide floats naturally. textclass for its existence. Also handle wide floats naturally.
* tex2lyx.h: associated changes to function declarations. * tex2lyx.h: associated changes to function declarations.
2003-07-18 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-07-18 Lars Gullik Bjønnes <larsbj@gullik.net>
* texparser.C (catInit): same warning avoidance as in math_parser.C * 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"; os << "\n\\end_deeper \n";
} }
} }
Context::Context(bool need_layout_, 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); end_layout(os);
need_end_layout = false; 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) { if (need_end_deeper) {
end_deeper(os); end_deeper(os);

View File

@ -32,7 +32,7 @@ struct Context {
// Output a \end_deeper if needed // Output a \end_deeper if needed
void check_end_deeper(std::ostream & os); void check_end_deeper(std::ostream & os);
// dump content on stream (for debugging purpose), with // dump content on stream (for debugging purpose), with
// description \c desc. // description \c desc.
void dump(std::ostream &, std::string const & desc = "context") const; 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 // we are handling a standard paragraph in an itemize-like
// environment // environment
bool deeper_paragraph; bool deeper_paragraph;
// The textclass of the document. Could actually be a global variable // The textclass of the document. Could actually be a global variable
LyXTextClass const & textclass; LyXTextClass const & textclass;
// The layout of the current paragraph // The layout of the current paragraph
@ -62,6 +62,6 @@ struct Context {
// The layout of the outer paragraph (for environment layouts) // The layout of the outer paragraph (for environment layouts)
LyXLayout_ptr parent_layout; LyXLayout_ptr parent_layout;
}; };
#endif #endif

View File

@ -143,7 +143,7 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode)
else if (t.cs() == "[") { else if (t.cs() == "[") {
// special handling of a few common SW user quirks // special handling of a few common SW user quirks
p.skip_spaces(); p.skip_spaces();
//if (p.next_token().cs() == //if (p.next_token().cs() ==
os << "\\["; os << "\\[";
parse_math(p, os, FLAG_EQUATION, MATH_MODE); parse_math(p, os, FLAG_EQUATION, MATH_MODE);
os << "\\]"; os << "\\]";
@ -216,7 +216,7 @@ void parse_math(Parser & p, ostream & os, unsigned flags, const mode_type mode)
else if (t.cs() == "ss") else if (t.cs() == "ss")
os << "ß"; os << "ß";
else else
os << t.asInput(); os << t.asInput();
if (flags & FLAG_LEAVE) { if (flags & FLAG_LEAVE) {

View File

@ -142,7 +142,7 @@ void handle_colalign(Parser & p, vector<ColInfo> & colinfo)
ci.special += t.character(); ci.special += t.character();
int const nargs = special_columns[t.character()]; int const nargs = special_columns[t.character()];
for (int i = 0; i < nargs; ++i) for (int i = 0; i < nargs; ++i)
ci.special += "{" + p.verbatim_item() + "}"; ci.special += "{" + p.verbatim_item() + "}";
//cerr << "handling special column '" << t << "' " << nargs //cerr << "handling special column '" << t << "' " << nargs
// << " '" << ci.special << "'\n"; // << " '" << ci.special << "'\n";
colinfo.push_back(ci); colinfo.push_back(ci);
@ -265,7 +265,7 @@ void parse_table(Parser & p, ostream & os, unsigned flags)
p.error("found 'end' unexpectedly"); p.error("found 'end' unexpectedly");
} }
else else
os << t.asInput(); os << t.asInput();
} }
} }
@ -312,7 +312,7 @@ void handle_tabular(Parser & p, ostream & os,
vector< vector<CellInfo> > cellinfo(lines.size()); vector< vector<CellInfo> > cellinfo(lines.size());
vector<RowInfo> rowinfo(lines.size()); vector<RowInfo> rowinfo(lines.size());
// split into rows // split into rows
//cerr << "// split into rows\n"; //cerr << "// split into rows\n";
for (size_t row = 0; row < rowinfo.size(); ++row) { for (size_t row = 0; row < rowinfo.size(); ++row) {
@ -320,7 +320,7 @@ void handle_tabular(Parser & p, ostream & os,
// init row // init row
cellinfo[row].resize(colinfo.size()); cellinfo[row].resize(colinfo.size());
// split row // split row
vector<string> dummy; vector<string> dummy;
//cerr << "\n########### LINE: " << lines[row] << "########\n"; //cerr << "\n########### LINE: " << lines[row] << "########\n";
split(lines[row], dummy, HLINE); 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 << " below 2: " << dummy[2] << "\n";
//cerr << "line: " << row << " cells 1: " << dummy[1] << "\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"; //cerr << " reading from line string '" << dummy[i] << "'\n";
Parser p1(dummy[i]); Parser p1(dummy[i]);
while (p1.good()) { while (p1.good()) {
@ -356,7 +356,7 @@ void handle_tabular(Parser & p, ostream & os,
handle_hline_above(rowinfo[row], cellinfo[row]); handle_hline_above(rowinfo[row], cellinfo[row]);
//cerr << "above row: " << row << endl; //cerr << "above row: " << row << endl;
} }
} else { } else {
//cerr << "below row: " << row << endl; //cerr << "below row: " << row << endl;
handle_hline_below(rowinfo[row], cellinfo[row]); 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) { cell < cells.size() && col < colinfo.size(); ++col, ++cell) {
//cerr << "cell content: '" << cells[cell] << "'\n"; //cerr << "cell content: '" << cells[cell] << "'\n";
Parser p(cells[cell]); Parser p(cells[cell]);
p.skip_spaces(); p.skip_spaces();
//cells[cell] << "'\n"; //cells[cell] << "'\n";
if (p.next_token().cs() == "multicolumn") { if (p.next_token().cs() == "multicolumn") {
// how many cells? // how many cells?
p.get_token(); p.get_token();
size_t const ncells = string2int(p.verbatim_item()); size_t const ncells = string2int(p.verbatim_item());
// special cell properties alignment // special cell properties alignment
vector<ColInfo> t; vector<ColInfo> t;
handle_colalign(p, t); handle_colalign(p, t);
cellinfo[row][col].multi = 1; cellinfo[row][col].multi = 1;
@ -420,7 +420,7 @@ void handle_tabular(Parser & p, ostream & os,
if (t.front().rightline > 1) if (t.front().rightline > 1)
cellinfo[row][col + 1].leftline = true; cellinfo[row][col + 1].leftline = true;
} else { } else {
// FLAG_END is a hack, we need to read all of it // FLAG_END is a hack, we need to read all of it
cellinfo[row][col].leftline = colinfo[col].leftline; cellinfo[row][col].leftline = colinfo[col].leftline;
cellinfo[row][col].rightline = colinfo[col].rightline; cellinfo[row][col].rightline = colinfo[col].rightline;
@ -480,7 +480,7 @@ void handle_tabular(Parser & p, ostream & os,
os << "<cell"; os << "<cell";
if (cell.multi) if (cell.multi)
os << " multicolumn=\"" << cell.multi << "\""; os << " multicolumn=\"" << cell.multi << "\"";
os << " alignment=\"" << verbose_align(cell.align) os << " alignment=\"" << verbose_align(cell.align)
<< "\"" << "\""
<< " valignment=\"top\""; << " valignment=\"top\"";
if (cell.topline) if (cell.topline)
@ -505,7 +505,7 @@ void handle_tabular(Parser & p, ostream & os,
} }
os << "</row>\n"; os << "</row>\n";
} }
os << "</lyxtabular>\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. everyzhere it makes sense.
A normal paragraph A normal paragraph
\begin{equation} \begin{equation}
x = \sin y x = \sin y
\end{equation} \end{equation}
with maths inside it. with maths inside it.
\begin{quote} \begin{quote}
@ -43,7 +43,7 @@ An environment
\end{figure} \end{figure}
A paragraph\footnote{hello} with a footnote and another A paragraph\footnote{hello} with a footnote and another
one\footnote{hello one\footnote{hello
there} with several paragraphs 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, //std::string parse_text(Parser & p, unsigned flags, const bool outer,
// Context & context); // 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); bool outer, Context & context);

View File

@ -136,7 +136,7 @@ string translate_len(string const & len)
return len; return len;
} }
void begin_inset(ostream & os, string const & name) void begin_inset(ostream & os, string const & name)
{ {
os << "\n\\begin_inset " << name; os << "\n\\begin_inset " << name;
@ -190,7 +190,7 @@ private:
LyXLayout_ptr findLayout(LyXTextClass const & textclass, LyXLayout_ptr findLayout(LyXTextClass const & textclass,
string const & name) string const & name)
{ {
LyXTextClass::const_iterator it = textclass.begin(); LyXTextClass::const_iterator it = textclass.begin();
LyXTextClass::const_iterator end = textclass.end(); 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_deeper(os);
context.check_layout(os); context.check_layout(os);
if (context.layout->optionalargs > 0) { if (context.layout->optionalargs > 0) {
string s; string s;
if (p.next_token().character() == '[') { if (p.next_token().character() == '[') {
p.get_token(); // eat '[' p.get_token(); // eat '['
begin_inset(os, "OptArg\n"); begin_inset(os, "OptArg\n");
@ -278,7 +278,7 @@ void parse_environment(Parser & p, ostream & os, bool outer,
} }
if (p.next_token().asInput() == "[") { if (p.next_token().asInput() == "[") {
height = translate_len(p.getArg('[', ']')); height = translate_len(p.getArg('[', ']'));
if (p.next_token().asInput() == "[") { if (p.next_token().asInput() == "[") {
switch(p.getArg('[', ']')[0]) { switch(p.getArg('[', ']')[0]) {
case 't': inner_pos = "0"; break; case 't': inner_pos = "0"; break;
@ -370,7 +370,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
flags |= FLAG_LEAVE; flags |= FLAG_LEAVE;
} }
if (t.character() == ']' && (flags & FLAG_BRACK_LAST)) if (t.character() == ']' && (flags & FLAG_BRACK_LAST))
return; 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 // extended to other quotes, but is not so easy (a
// left english quote is the same as a right german // left english quote is the same as a right german
// quote...) // quote...)
else if (t.asInput() == "`" else if (t.asInput() == "`"
&& p.next_token().asInput() == "`") { && p.next_token().asInput() == "`") {
context.check_layout(os); context.check_layout(os);
begin_inset(os, "Quotes "); begin_inset(os, "Quotes ");
@ -412,8 +412,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
end_inset(os); end_inset(os);
p.get_token(); p.get_token();
skip_braces(p); skip_braces(p);
} }
else if (t.asInput() == "'" else if (t.asInput() == "'"
&& p.next_token().asInput() == "'") { && p.next_token().asInput() == "'") {
context.check_layout(os); context.check_layout(os);
begin_inset(os, "Quotes "); begin_inset(os, "Quotes ");
@ -421,7 +421,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
end_inset(os); end_inset(os);
p.get_token(); p.get_token();
skip_braces(p); skip_braces(p);
} }
else if (t.cat() == catLetter || else if (t.cat() == catLetter ||
@ -450,14 +450,14 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
if (t.character() == '~') { if (t.character() == '~') {
if (context.layout->free_spacing) if (context.layout->free_spacing)
os << ' '; os << ' ';
else else
os << "\\InsetSpace ~\n"; os << "\\InsetSpace ~\n";
} else } else
os << t.character(); os << t.character();
} }
else if (t.cat() == catBegin) { else if (t.cat() == catBegin) {
// FIXME??? // FIXME???
// special handling of size changes // special handling of size changes
context.check_layout(os); context.check_layout(os);
bool const is_size = is_known(p.next_token().cs(), known_sizes); 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") { else if (t.cs() == "item") {
// should be done automatically by Parser::tokenize // should be done automatically by Parser::tokenize
//p.skip_spaces(); //p.skip_spaces();
string s; string s;
if (p.next_token().character() == '[') { if (p.next_token().character() == '[') {
p.get_token(); // eat '[' p.get_token(); // eat '['
Context newcontext(false, context.textclass); 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") { else if (t.cs() == "includegraphics") {
map<string, string> opts = split_map(p.getArg('[', ']')); map<string, string> opts = split_map(p.getArg('[', ']'));
string name = p.verbatim_item(); string name = p.verbatim_item();
context.check_layout(os); context.check_layout(os);
begin_inset(os, "Graphics "); begin_inset(os, "Graphics ");
os << "\n\tfilename " << name << '\n'; 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'; << translate_len(opts["height"]) << '\n';
end_inset(os); end_inset(os);
} }
else if (t.cs() == "footnote") { else if (t.cs() == "footnote") {
context.check_layout(os); context.check_layout(os);
begin_inset(os, "Foot\n"); begin_inset(os, "Foot\n");
@ -661,7 +661,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
os << name << "\n"; os << name << "\n";
end_inset(os); end_inset(os);
p.get_token(); // swallow second arg p.get_token(); // swallow second arg
} else } else
handle_ert(os, "\\listof{" + name + "}", context); 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"; 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") { || t.cs() == "LaTeX") {
context.check_layout(os); context.check_layout(os);
os << t.cs(); os << t.cs();
@ -811,8 +811,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
skip_braces(p); skip_braces(p);
} }
else if (t.cs() == "_" || t.cs() == "&" || t.cs() == "#" else if (t.cs() == "_" || t.cs() == "&" || t.cs() == "#"
|| t.cs() == "$" || t.cs() == "{" || t.cs() == "}" || t.cs() == "$" || t.cs() == "{" || t.cs() == "}"
|| t.cs() == "%") { || t.cs() == "%") {
context.check_layout(os); context.check_layout(os);
os << t.cs(); os << t.cs();
@ -877,12 +877,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
os << "\n\\newline \n"; os << "\n\\newline \n";
} }
} }
else if (t.cs() == "input" || t.cs() == "include" else if (t.cs() == "input" || t.cs() == "include"
|| t.cs() == "verbatiminput") { || t.cs() == "verbatiminput") {
string name = '\\' + t.cs(); string name = '\\' + t.cs();
if (t.cs() == "verbatiminput" if (t.cs() == "verbatiminput"
&& p.next_token().asInput() == "*") && p.next_token().asInput() == "*")
name += p.get_token().asInput(); name += p.get_token().asInput();
context.check_layout(os); context.check_layout(os);
begin_inset(os, "Include "); begin_inset(os, "Include ");

View File

@ -10,7 +10,7 @@
* Full author contact details are available in file CREDITS. * Full author contact details are available in file CREDITS.
* *
* This file contains some utility functions for actually mutating * 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 #ifndef TEXT_FUNCS_H

View File

@ -53,10 +53,10 @@ public:
undo_kind kind; 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 -1, then the cursor is not in an inset.
* if >= 0, then the cursor is in inset with given id. * if >= 0, then the cursor is in inset with given id.
*/ */
int inset_id; int inset_id;
/// Offset to the first paragraph in the main document paragraph list /// 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. // Nobody wants all removed character appear one by one when undoing.
if (! undo_finished && kind != Undo::ATOMIC) { if (! undo_finished && kind != Undo::ATOMIC) {
// Check whether storing is needed. // Check whether storing is needed.
if (! buf->undostack().empty() if (! buf->undostack().empty()
&& buf->undostack().top().kind == kind && buf->undostack().top().kind == kind
&& buf->undostack().top().first_par_offset == first_offset && buf->undostack().top().first_par_offset == first_offset
&& buf->undostack().top().last_par_offset == last_offset) { && buf->undostack().top().last_par_offset == last_offset) {
// No additonal undo recording needed - // No additonal undo recording needed -
@ -117,7 +117,7 @@ bool performUndoOrRedo(BufferView * bv, Undo & undo)
advance(last, plist.size() - undo.last_par_offset); advance(last, plist.size() - undo.last_par_offset);
plist.erase(first, ++last); plist.erase(first, ++last);
} }
// Re-insert old stuff instead // Re-insert old stuff instead
{ {
if (plist.empty()) { if (plist.empty()) {