BufferView(LyXView * owner, int x, int y, int w, int h);
~BufferView();
-
+
/// set the buffer we are viewing
void buffer(Buffer * b);
/// return the buffer being viewed
Buffer * buffer() const;
-
+
/// return the painter object for drawing onto the view
Painter & painter() const;
/// return the screen object for handling re-drawing
LyXScreen & screen() const;
/// return the owning main view
LyXView * owner() const;
-
+
/// resize event has happened
void resize();
/**
* repaint of the whole screen.
*/
void repaint();
-
+
/// fit the user cursor within the visible view
bool fitCursor();
/// perform pending painting updates
void updateScrollbar();
/// FIXME
void redoCurrentBuffer();
-
+
/// FIXME
bool available() const;
-
+
/// FIXME
void beforeChange(LyXText *);
-
+
/// Save the current position as bookmark i
void savePosition(unsigned int i);
/// Restore the position from bookmark i
void restorePosition(unsigned int i);
/// does the given bookmark have a saved position ?
bool isSavedPosition(unsigned int i);
-
+
/**
* This holds the mapping between buffer paragraphs and screen rows.
* This should be private...but not yet. (Lgb)
LyXText * text;
/// return the lyxtext we are using
LyXText * getLyXText() const;
-
+
/// Return the current inset we are "locked" in
UpdatableInset * theLockingInset() const;
/// lock the given inset FIXME: return value ?
int unlockInset(UpdatableInset * inset);
/// unlock the currently locked inset
void insetUnlock();
-
+
/// return the parent language of the given inset
Language const * getParentLanguage(Inset * inset) const;
-
+
/// Select the "current" word
void selectLastWord();
/// replace the currently selected word
void endOfSpellCheck();
/// return the next word
WordLangTuple const nextWord(float & value);
-
+
/// move cursor to the named label
bool gotoLabel(string const & label);
-
+
/// copy the environment type from current paragraph
void copyEnvironment();
/// set the current paragraph's environment type
void pasteEnvironment();
-
+
/// undo last action
void undo();
/// redo last action
void redo();
-
+
/// removes all autodeletable insets
bool removeAutoInsets();
/// insert all errors found when running latex
void insertErrors(TeXErrors & terr);
/// set the cursor based on the given TeX source row
void setCursorFromRow(int row);
-
+
/**
* Insert an inset into the buffer.
* Place it in a layout of lout,
*/
bool insertInset(Inset * inset, string const & lout = string());
-
+
/// Inserts a lyx file at cursor position. return false if it fails
bool insertLyXFile(string const & file);
-
+
/// show the user cursor
void showCursor();
/// hide the user cursor
void toggleSelection(bool = true);
/// FIXME: my word !
void toggleToggle();
-
+
/// center the document view around the cursor
void center();
/// scroll document by the given number of lines of default height
bool ChangeRefsIfUnique(string const & from, string const & to);
/// FIXME
bool ChangeCitationsIfUnique(string const & from, string const & to);
-
+
/// get the contents of the window system clipboard
string const getClipboard() const;
/// fill the window system clipboard
void stuffClipboard(string const &) const;
/// tell the window system we have a selection
void haveSelection(bool sel);
-
+
/// execute the given function
bool dispatch(FuncRequest const & argument);
-
+
private:
/// Set the current locking inset
void theLockingInset(UpdatableInset * inset);
-
+
/// return the lyxtext containing this inset
LyXText * getParentText(Inset * inset) const;
-
+
/**
* Change all insets with the given code's contents to a new
* string. May only be used with InsetCommand-derived insets
*/
bool ChangeInsets(Inset::Code code, string const & from,
string const & to);
-
+
struct Pimpl;
friend struct BufferView::Pimpl;
+2002-12-01 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * text2.C (setCounter): clean up a bit, use boost.format.
+ (updateCounters): initialize par upon declaration.
+
+ * CutAndPaste.C (SwitchLayoutsBetweenClasses): set the layout also
+ if the layout exists. We do not just store the layout any more.
+ (SwitchLayoutsBetweenClasses): use boost.format
+
2002-11-18 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* converter.C (convert): if from and to files are the same, use a
2002-11-22 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
- * commandtags.h:
+ * commandtags.h:
* LyXAction.C (init): remove LFUN_VECTOR (bug 662)
2002-11-27 Dekel Tsur <dekelts@tau.ac.il>
#include "insets/inseterror.h"
+#include <boost/format.hpp>
+
using std::pair;
using lyx::pos_type;
using lyx::textclass_type;
string const name = par->layout()->name();
bool hasLayout = tclass2.hasLayout(name);
- if (!hasLayout)
+ if (hasLayout)
+ par->layout(tclass2[name]);
+ else
par->layout(tclass2.defaultLayout());
if (!hasLayout && name != tclass1.defaultLayoutName()) {
++ret;
+#if USE_BOOST_FORMAT
+ boost::format fmt(_("Layout had to be changed from\n"
+ "%1$s to %2$s\n"
+ "because of class conversion from\n"
+ "%3$s to %4$s"));
+ fmt % name
+ % par->layout()->name()
+ % tclass1.name()
+ % tclass2.name();
+
+ string const s = fmt.str();
+#else
string const s = _("Layout had to be changed from\n")
+ name + _(" to ")
+ par->layout()->name()
+ _("\nbecause of class conversion from\n")
+ tclass1.name() + _(" to ")
+ tclass2.name();
+#endif
freezeUndo();
InsetError * new_inset = new InsetError(s);
LyXText * txt = current_view->getLyXText();
+2002-12-01 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * ControlDocument.C (classApply): use boost.format
+
2002-11-29 Angus Leeming <leeming@lyx.org>
* ControlButtons.h (isClosing): make it public, so that the view can
dialog isClosing(). (Ie, if the "save" button has been pressed.)
2002-11-28 John Levon <levon@movementarian.org>
-
- * ControlSpellchecker.C: fix Lars' broken cleanup
+
+ * ControlSpellchecker.C: fix Lars' broken cleanup
2002-11-27 Juergen Spitzmueller <j.spitzmueller@gmx.de>
#include "support/lstrings.h"
#include "support/filetools.h"
+#include <boost/format.hpp>
+
+using std::endl;
+
ControlDocument::ControlDocument(LyXView & lv, Dialogs & d)
: ControlDialogBD(lv, d), bp_(0)
view().apply();
buffer()->params = *bp_;
-
+
lv_.view()->redoCurrentBuffer();
buffer()->markDirty();
// successfully loaded
view().apply();
buffer()->params = *bp_;
+
lv_.message(_("Converting document to new document class..."));
int ret = CutAndPaste::SwitchLayoutsBetweenClasses(
old_class, new_class,
if (ret == 1) {
s = _("One paragraph couldn't be converted");
} else {
+#if USE_BOOST_FORMAT
+ boost::format fmt(_("%1$s paragraphs couldn't be converted"));
+ fmt % ret;
+ s = fmt.str();
+#else
s += tostr(ret);
s += _(" paragraphs couldn't be converted");
+#endif
}
Alert::alert(_("Conversion Errors!"),s,
_("into chosen document class"));
_("for the document layout as default?"),
_("(they will be valid for any new document)")))
return;
-
+
lv_.buffer()->params.preamble = bp_->preamble;
string const fname = AddName(AddPath(user_lyxdir, "templates/"),
+2002-12-01 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * checkedwidgets.C (setWidget): make sure that FL_LCOL and FL_COL1
+ will be seen as FL_COLORs.
+
2002-12-01 John Levon <levon@movementarian.org>
* FormMathsBitmap.C: fix _(_(blah))
-
+
2002-11-30 John Levon <levon@movementarian.org>
* FormMathsBitmap.C: actually set dialog_->button_close
to the added button
-
+
2002-11-30 John Levon <levon@movementarian.org>
* forms/form_maths_panel.fd: small fix
-
+
2002-11-29 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* lyx_gui.C (start): make "unhandled X11 event" debug message
skip_used && length_input);
setEnabled(class_->choice_doc_skip_units,
skip_used && length_input);
-
+
// Default unit choice is cm if metric, inches if US paper.
// If papersize is default, check the lyxrc-settings
int const paperchoice = fl_get_choice(paper_->choice_papersize);
// define color to mark invalid input
FL_COLOR const alert_col = FL_RED;
- FL_COLOR const lcol = valid ? FL_LCOL : alert_col;
+ FL_COLOR const lcol = valid ? FL_COLOR(FL_LCOL) : alert_col;
if (label->lcol != lcol && isActive(label)) {
fl_set_object_lcol(label, lcol);
}
// Reflect the validity of the data in the background color of the
// input widget only when this widget is not being edited.
- FL_COLOR const icol1 = valid ? FL_COL1 : alert_col;
+ FL_COLOR const icol1 = valid ? FL_COLOR(FL_COL1) : alert_col;
if (input->col1 != icol1) {
fl_set_object_color(input, icol1, FL_MCOL);
}
+2002-12-01 Lars Gullik Bjønnes <larsbj@gullik.net>
+
+ * insetquotes.C (dispString): use string::insert for prepending a
+ char.
+
2002-11-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insetparent.C (getScreenLabel): use boost::format
if (side_ == LeftQ)
disp += ' ';
else
- disp = ' ' + disp;
+ disp.insert(0, 1, ' ');
}
return disp;
///
void cursorLeftOneWord(LyXCursor &) const;
-
+
///
float getCursorX(BufferView *, Row *, lyx::pos_type pos,
lyx::pos_type last, bool boundary) const;
/** inserts a new row behind the specified row, increments
the touched counters */
void insertRow(Row * row, Paragraph * par, lyx::pos_type pos) const;
- /// removes the row and reset the touched counters
+ /// removes the row and reset the touched counters
void removeRow(Row * row) const;
/// remove all following rows of the paragraph of the specified row.
void removeParagraph(Row * row) const;
- /// insert the specified paragraph behind the specified row
+ /// insert the specified paragraph behind the specified row
void insertParagraph(BufferView *,
Paragraph * par, Row * row) const;
/// paint page break marker. Returns its height.
int paintPageBreak(string const & label, int y, DrawRowParams & p);
-
+
/// paint env depth bar
void paintRowDepthBar(DrawRowParams & p);
/** Updates all counters starting BEHIND the row. Changed paragraphs
* with a dynamic left margin will be rebroken. */
void updateCounters(BufferView *) const;
- ///
+ ///
void update(BufferView * bv, bool changed = true);
/**
* Returns an inset if inset was hit, or 0 if not.
///
lyx::pos_type beginningOfMainBody(Buffer const *, Paragraph const * par) const;
- /**
+ /**
* Returns the left beginning of the text.
* This information cannot be taken from the layout object, because
* in LaTeX the beginning of the text fits in some cases
#include "support/textutils.h"
#include "support/lstrings.h"
+#include <boost/format.hpp>
+
using std::vector;
using std::copy;
using std::endl;
// is it a layout that has an automatic label?
if (layout->labeltype >= LABEL_COUNTER_CHAPTER) {
+ int const i = layout->labeltype - LABEL_COUNTER_CHAPTER;
- int i = layout->labeltype - LABEL_COUNTER_CHAPTER;
- string numbertype;
- string langtype;
ostringstream s;
if (i >= 0 && i <= buf->params.secnumdepth) {
+ string numbertype;
+ string langtype;
textclass.counters().step(layout->latexname());
// Is there a label? Useful for Chapter layout
if (!par->params().appendix()) {
- if (!layout->labelstring().empty())
- par->params().labelString(layout->labelstring());
- else
- par->params().labelString(string());
+ s << layout->labelstring();
} else {
- if (!layout->labelstring_appendix().empty())
- par->params().labelString(layout->labelstring_appendix());
- else
- par->params().labelString(string());
+ s << layout->labelstring_appendix();
}
- // Use if an integer is here less than elegant. For now.
+ // Use of an integer is here less than elegant. For now.
int head = textclass.maxcounter() - LABEL_COUNTER_CHAPTER;
if (!par->params().appendix()) {
numbertype = "sectioning";
.numberLabel(layout->latexname(),
numbertype, langtype, head);
- par->params().labelString(par->params().labelString()
- + STRCONV(s.str()));
+ par->params().labelString(STRCONV(s.str()));
// reset enum counters
textclass.counters().reset("enum");
textclass.counters().step(enumcounter);
s << textclass.counters()
- .numberLabel(enumcounter,
- "enumeration", langtype);
+ .numberLabel(enumcounter, "enumeration");
par->params().labelString(STRCONV(s.str()));
}
} else if (layout->labeltype == LABEL_BIBLIO) {// ale970302
textclass.counters().step(fl.type());
// Doesn't work... yet.
+#warning use boost.format
+#if USE_BOOST_FORMAT
+ s = boost::io::str(boost::format(_("%1$s #:")) % fl.name());
+ // s << boost::format(_("%1$s %1$d:")
+ // % fl.name()
+ // % buf->counters().value(fl.name());
+#else
ostringstream o;
//o << fl.name() << ' ' << buf->counters().value(fl.name()) << ":";
o << fl.name() << " #:";
s = STRCONV(o.str());
+#endif
} else {
// par->SetLayout(0);
// s = layout->labelstring;
- s = (par->getParLanguage(buf->params)->lang() == "hebrew")
- ? " :úåòîùî øñç" : "Senseless: ";
+ s = _("Senseless: ");
}
}
par->params().labelString(s);
// Updates all counters. Paragraphs with changed label string will be rebroken
void LyXText::updateCounters(BufferView * bview) const
{
- Paragraph * par;
-
Row * row = firstrow;
- par = row->par();
+ Paragraph * par = row->par();
// CHECK if this is really needed. (Lgb)
bview->buffer()->params.getLyXTextClass().counters().reset();
string const oldLabel = par->params().labelString();
+ // setCounter can potentially change the labelString.
setCounter(bview->buffer(), par);
string const & newLabel = par->params().labelString();