screen_->update(bv_->text, bv_);
bool fitc = false;
while (bv_->text->status() == LyXText::CHANGED_IN_DRAW) {
- if (bv_->text->fullRebreak(bv_)) {
- st = LyXText::NEED_MORE_REFRESH;
- bv_->text->setCursor(bv_, bv_->text->cursor.par(),
- bv_->text->cursor.pos());
- if (bv_->text->selection.set()) {
- bv_->text->setCursor(bv_, bv_->text->selection.start,
- bv_->text->selection.start.par(),
- bv_->text->selection.start.pos());
- bv_->text->setCursor(bv_, bv_->text->selection.end,
- bv_->text->selection.end.par(),
- bv_->text->selection.end.pos());
- }
- fitc = true;
+ bv_->text->fullRebreak(bv_);
+ st = LyXText::NEED_MORE_REFRESH;
+ bv_->text->setCursor(bv_, bv_->text->cursor.par(),
+ bv_->text->cursor.pos());
+ if (bv_->text->selection.set()) {
+ bv_->text->setCursor(bv_, bv_->text->selection.start,
+ bv_->text->selection.start.par(),
+ bv_->text->selection.start.pos());
+ bv_->text->setCursor(bv_, bv_->text->selection.end,
+ bv_->text->selection.end.par(),
+ bv_->text->selection.end.pos());
}
+ fitc = true;
bv_->text->status(bv_, st);
screen_->update(bv_->text, bv_);
}
lyxerr[Debug::ACTION] << "BufferView::Pimpl::Dispatch: action["
<< action <<"] arg[" << argument << "]" << endl;
+ LyXTextClass const & tclass = textclasslist[buffer_->params.textclass];
+
switch (action) {
// --- Misc -------------------------------------------
case LFUN_APPENDIX:
InsetCommandParams p;
p.setCmdName("tableofcontents");
Inset * inset = new InsetTOC(p);
- if (!insertInset(inset, "Standard"))
+ if (!insertInset(inset, tclass.defaultLayoutName()))
delete inset;
break;
}
// Derive layout number from given argument (string)
// and current buffer's textclass (number). */
- textclass_type tclass = buffer_->params.textclass;
- bool hasLayout =
- textclasslist[tclass].hasLayout(argument);
+ bool hasLayout = tclass.hasLayout(argument);
string layout = argument;
// If the entry is obsolete, use the new one instead.
if (hasLayout) {
- string const & obs = textclasslist[tclass][layout]
- .obsoleted_by();
+ string const & obs = tclass[layout].obsoleted_by();
if (!obs.empty())
layout = obs;
}
{
LyXText * lt = bv_->getLyXText();
- LyXLayout const & style = textclasslist[buffer_->params.textclass][lt->cursor.par()->layout()];
+ LyXLayout const & style = tclass[lt->cursor.par()->layout()];
if (style.free_spacing) {
lt->insertChar(bv_, ' ');
{
InsetCommandParams p("printindex");
Inset * inset = new InsetPrintIndex(p);
- if (!insertInset(inset, "Standard"))
+ if (!insertInset(inset, tclass.defaultLayoutName()))
delete inset;
}
break;
{
InsetCommandParams p("lyxparent", argument);
Inset * inset = new InsetParent(p, *buffer_);
- if (!insertInset(inset, "Standard"))
+ if (!insertInset(inset, tclass.defaultLayoutName()))
delete inset;
}
case LFUN_FLOAT_LIST:
if (floatList.typeExist(argument)) {
Inset * inset = new InsetFloatList(argument);
- if (!insertInset(inset, "Standard"))
+ if (!insertInset(inset, tclass.defaultLayoutName()))
delete inset;
} else {
lyxerr << "Non-existent float type: "
+2002-05-02 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * screen.C (drawFromTo): change sine fullRebreak always return
+ true.
+
+ * buffer.C (parseSingleLyXformat2Token): reindent some
+
+ * BufferView_pimpl.C (update): change since fullRebreak always
+ return true.
+ (Dispatch): git rid of the last hardcoded "Standard"s.
+
+2002-05-01 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * text2.[Ch] (fullRebreak): make it return void now that we always
+ returned true.
+
2002-04-30 Juergen Vigna <jug@sad.it>
* buffer.C (parseSingleLyXformat2Token): reset the font before the
2002-04-29 Dekel Tsur <dekelts@tau.ac.il>
- * buffer.C (parseSingleLyXformat2Token): Fix reading of old format
+ * buffer.C (parseSingleLyXformat2Token): Fix reading of old format
minipages: use col% instead of p%, and also use the current font.
(makeLaTeXFile): Fix use babel condition.
(parseSingleLyXformat2Token): Correct font when reading old floats.
2002-04-28 Dekel Tsur <dekelts@tau.ac.il>
- * BufferView_pimpl.C (Dispatch): Check that float type exists when
+ * BufferView_pimpl.C (Dispatch): Check that float type exists when
inserting list of floats.
2002-04-25 Herbert Voss <voss@lyx.org>
2002-04-23 Mike Ressler <mike.ressler@alum.mit.edu>
- * lyxtextclass.[Ch]: add layout keyword ProvidesNatbib.
+ * lyxtextclass.[Ch]: add layout keyword ProvidesNatbib.
* LaTeXFeatures.C: do not add \usepackage{natbib} to tex file if
natbib is provided by the LaTeX class.
-
+
2002-04-23 Juergen Vigna <jug@sad.it>
* BufferView_pimpl.[Ch]: remove use of wrong and unneeded insetSleep/
* tabular.C (OldFormatRead): check also for \\end_inset as Lars
changed the read and substituted \\end_float with \\end_inset!
- * BufferView_pimpl.C (cursorPrevious):
+ * BufferView_pimpl.C (cursorPrevious):
(cursorNext): fixed to make it work with rows heigher than the work
area without moving the cursor only the draw of the row.
(workAreaMotionNotify): fix jumping over high rows.
LyXLookupString(ev, dummy, 1, &keysym);
#else
XLookupString(xke, dummy, 1, &keysym, 0);
+// int num_keys = XLookupString(xke, dummy, 10, &keysym, &xcs);
+// lyxerr << "We have " << num_keys << " keys in the returned buffer" << endl;
+// lyxerr << "Our dummy string is " << dummy << endl;
#endif
if (lyxerr.debugging(Debug::KEY)) {
char const * tmp = XKeysymToString(key);
font = LyXFont(LyXFont::ALL_INHERIT, params.language);
if (file_format < 216 && params.language->lang() == "hebrew")
font.setLanguage(default_language);
-
+
#ifndef NO_COMPABILITY
if (compare_no_case(layoutname, "latex") == 0) {
ert_comp.active = true;
// minipage. Currently I am not investing any effort
// in fixing those cases.
- //lyxerr << "Call depth: " << call_depth << endl;
+// lyxerr << "Call depth: " << call_depth << endl;
+// lyxerr << "Checkminipage: " << checkminipage << endl;
+
if (checkminipage && (call_depth == 1)) {
- checkminipage = false;
- if (minipar && (minipar != par) &&
- (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE))
- {
- lyxerr << "minipages in a row" << endl;
- if (par->params().pextraStartMinipage()) {
- lyxerr << "start new minipage" << endl;
- // minipages in a row
- par->previous()->next(0);
- par->previous(0);
+ checkminipage = false;
+ if (minipar && (minipar != par) &&
+ (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE)) {
+ lyxerr << "minipages in a row" << endl;
+ if (par->params().pextraStartMinipage()) {
+ lyxerr << "start new minipage" << endl;
+ // minipages in a row
+ par->previous()->next(0);
+ par->previous(0);
+
+ Paragraph * tmp = minipar;
+ while (tmp) {
+ tmp->params().pextraType(0);
+ tmp->params().pextraWidth(string());
+ tmp->params().pextraWidthp(string());
+ tmp->params().pextraAlignment(0);
+ tmp->params().pextraHfill(false);
+ tmp->params().pextraStartMinipage(false);
+ tmp = tmp->next();
+ }
+ // create a new paragraph to insert the
+ // minipages in the following case
+ if (par->params().pextraStartMinipage() &&
+ !par->params().pextraHfill()) {
+ Paragraph * p = new Paragraph;
+ p->layout(textclasslist[params.textclass].defaultLayoutName());
+
+ p->previous(parBeforeMinipage);
+ parBeforeMinipage->next(p);
+ p->next(0);
+ p->params().depth(parBeforeMinipage->params().depth());
+ parBeforeMinipage = p;
+ }
+ InsetMinipage * mini = new InsetMinipage(params);
+ mini->pos(static_cast<InsetMinipage::Position>(par->params().pextraAlignment()));
+ mini->pageWidth(LyXLength(par->params().pextraWidth()));
+ if (!par->params().pextraWidthp().empty()) {
+ lyxerr << "WP:" << mini->pageWidth().asString() << endl;
+ mini->pageWidth(LyXLength((par->params().pextraWidthp())+"col%"));
+ }
+ Paragraph * op = mini->firstParagraph();
+ mini->inset.paragraph(par);
+ //
+ // and free the old ones!
+ //
+ while(op) {
+ Paragraph * pp = op->next();
+ delete op;
+ op = pp;
+ }
+ // Insert the minipage last in the
+ // previous paragraph.
+ if (par->params().pextraHfill()) {
+ parBeforeMinipage->insertChar
+ (parBeforeMinipage->size(),
+ Paragraph::META_HFILL, font);
+ }
+ parBeforeMinipage->insertInset
+ (parBeforeMinipage->size(), mini, font);
+ minipar = par;
+ } else {
+ lyxerr << "new minipage par" << endl;
+ //nothing to do just continue reading
+ }
+
+ } else if (minipar && (minipar != par)) {
+ lyxerr << "last minipage par read" << endl;
+ // The last paragraph read was not part of a
+ // minipage but the par linked list is...
+ // So we need to remove the last par from the
+ // rest
+ if (par->previous())
+ par->previous()->next(0);
+ par->previous(parBeforeMinipage);
+ parBeforeMinipage->next(par);
Paragraph * tmp = minipar;
while (tmp) {
tmp->params().pextraType(0);
tmp->params().pextraStartMinipage(false);
tmp = tmp->next();
}
- // create a new paragraph to insert the
- // minipages in the following case
- if (par->params().pextraStartMinipage() &&
- !par->params().pextraHfill()) {
- Paragraph * p = new Paragraph;
- p->layout(textclasslist[params.textclass].defaultLayoutName());
+ depth = parBeforeMinipage->params().depth();
+ // and set this depth on the par as it has not been set already
+ par->params().depth(depth);
+ minipar = parBeforeMinipage = 0;
+ } else if (!minipar &&
+ (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE)) {
+ // par is the first paragraph in a minipage
+ lyxerr << "begin minipage" << endl;
+ // To minimize problems for
+ // the users we will insert
+ // the first minipage in
+ // a sequence of minipages
+ // in its own paragraph.
+ Paragraph * p = new Paragraph;
+ p->layout(textclasslist[params.textclass].defaultLayoutName());
+ p->previous(par->previous());
+ p->next(0);
+ p->params().depth(depth);
+ par->params().depth(0);
+ depth = 0;
+ if (par->previous())
+ par->previous()->next(p);
+ par->previous(0);
+ parBeforeMinipage = p;
+ minipar = par;
+ if (!first_par || (first_par == par))
+ first_par = p;
- p->previous(parBeforeMinipage);
- parBeforeMinipage->next(p);
- p->next(0);
- p->params().depth(parBeforeMinipage->params().depth());
- parBeforeMinipage = p;
- }
InsetMinipage * mini = new InsetMinipage(params);
- mini->pos(static_cast<InsetMinipage::Position>(par->params().pextraAlignment()));
- mini->pageWidth(LyXLength(par->params().pextraWidth()));
+ mini->pos(static_cast<InsetMinipage::Position>(minipar->params().pextraAlignment()));
+ mini->pageWidth(LyXLength(minipar->params().pextraWidth()));
if (!par->params().pextraWidthp().empty()) {
- lyxerr << "WP:" << mini->pageWidth().asString() << endl;
- mini->pageWidth(LyXLength((par->params().pextraWidthp())+"col%"));
+ lyxerr << "WP:" << mini->pageWidth().asString() << endl;
+ mini->pageWidth(LyXLength((par->params().pextraWidthp())+"col%"));
}
+
Paragraph * op = mini->firstParagraph();
- mini->inset.paragraph(par);
+ mini->inset.paragraph(minipar);
//
// and free the old ones!
//
delete op;
op = pp;
}
+
// Insert the minipage last in the
// previous paragraph.
- if (par->params().pextraHfill()) {
+ if (minipar->params().pextraHfill()) {
parBeforeMinipage->insertChar
(parBeforeMinipage->size(),
Paragraph::META_HFILL, font);
}
parBeforeMinipage->insertInset
(parBeforeMinipage->size(), mini, font);
-
- minipar = par;
- } else {
- lyxerr << "new minipage par" << endl;
- //nothing to do just continue reading
- }
-
- } else if (minipar && (minipar != par)) {
- lyxerr << "last minipage par read" << endl;
- // The last paragraph read was not part of a
- // minipage but the par linked list is...
- // So we need to remove the last par from the
- // rest
- if (par->previous())
- par->previous()->next(0);
- par->previous(parBeforeMinipage);
- parBeforeMinipage->next(par);
- Paragraph * tmp = minipar;
- while (tmp) {
- tmp->params().pextraType(0);
- tmp->params().pextraWidth(string());
- tmp->params().pextraWidthp(string());
- tmp->params().pextraAlignment(0);
- tmp->params().pextraHfill(false);
- tmp->params().pextraStartMinipage(false);
- tmp = tmp->next();
- }
- depth = parBeforeMinipage->params().depth();
- // and set this depth on the par as it has not been set already
- par->params().depth(depth);
- minipar = parBeforeMinipage = 0;
- } else if (!minipar &&
- (par->params().pextraType() == Paragraph::PEXTRA_MINIPAGE))
- {
- // par is the first paragraph in a minipage
- lyxerr << "begin minipage" << endl;
- // To minimize problems for
- // the users we will insert
- // the first minipage in
- // a sequence of minipages
- // in its own paragraph.
- Paragraph * p = new Paragraph;
- p->layout(textclasslist[params.textclass].defaultLayoutName());
- p->previous(par->previous());
- p->next(0);
- p->params().depth(depth);
- par->params().depth(0);
- depth = 0;
- if (par->previous())
- par->previous()->next(p);
- par->previous(0);
- parBeforeMinipage = p;
- minipar = par;
- if (!first_par || (first_par == par))
- first_par = p;
-
- InsetMinipage * mini = new InsetMinipage(params);
- mini->pos(static_cast<InsetMinipage::Position>(minipar->params().pextraAlignment()));
- mini->pageWidth(LyXLength(minipar->params().pextraWidth()));
- if (!par->params().pextraWidthp().empty()) {
- lyxerr << "WP:" << mini->pageWidth().asString() << endl;
- mini->pageWidth(LyXLength((par->params().pextraWidthp())+"col%"));
- }
-
- Paragraph * op = mini->firstParagraph();
- mini->inset.paragraph(minipar);
- //
- // and free the old ones!
- //
- while(op) {
- Paragraph * pp = op->next();
- delete op;
- op = pp;
- }
-
- // Insert the minipage last in the
- // previous paragraph.
- if (minipar->params().pextraHfill()) {
- parBeforeMinipage->insertChar
- (parBeforeMinipage->size(),
- Paragraph::META_HFILL, font);
- }
- parBeforeMinipage->insertInset
- (parBeforeMinipage->size(), mini, font);
- }
+ }
}
// End of pextra_minipage compability
--call_depth;
string const opt = par->bibkey->getOptions();
string const ref = par->asString(this, false);
string const info = opt + "TheBibliographyRef" + ref;
-
+
keys.push_back(StringPair(key, info));
}
par = par->next();
2002-04-30 Rob Lahaye <lahaye@users.sourceforge.net>
* FormDocument.C: "USletter" -> "US letter" etc.
- "Other" -> "Custom".
+ "Other" -> "Custom".
* FormParagraph.C: "Other" -> "Custom"
* FormPreferences.C: "USletter" -> "US letter" etc.
* forms/form_document.fd: 'Papersize" -> "Paper size"
- style consistency
+ style consistency
* forms/form_preferences.fd: style consistency
2002-04-30 Angus Leeming <a.leeming@ic.ac.uk>
* FormBibtex.C:
* FormCitation.C: fix two typos
-
+
2002-04-29 Angus Leeming <a.leeming@ic.ac.uk>
* FormCharacter.h:
* FormMathsPanel.C: translate Close
* FormGraphics.C: a little more translation
-
+
2002-04-22 Angus Leeming <a.leeming@ic.ac.uk>
* FormCitation.C (apply, input): ensure that the choice is always valid.
return _(it->second.name());
}
-
+
} // namespace anon
int InsetIndex::docbook(Buffer const *, ostream & os) const
{
- os << "<indexterm><primary>" << getContents() << "</primary></indexterm>";
- return 0;
+ os << "<indexterm><primary>" << getContents()
+ << "</primary></indexterm>";
+ return 0;
}
: InsetCommand(p)
{}
+
string const InsetPrintIndex::getScreenLabel(Buffer const *) const
{
return _("Index");
///
void edit(BufferView *, bool = true) {}
///
- EDITABLE editable() const{ return NOT_EDITABLE; }
+ EDITABLE editable() const { return NOT_EDITABLE; }
///
bool display() const { return true; }
///
Inset::Code lyxCode() const;
///
string const getScreenLabel(Buffer const *) const;
+ ///
+ virtual bool needFullRow() const { return true; }
};
#endif
int yf = y_offset + first;
y = 0;
while ((row != 0) && (yf < ph)) {
- lt->getVisibleRow(bv, y+y_offset+first, int(x), row,
- y+lt->first_y, cleared);
+ lt->getVisibleRow(bv, y + y_offset + first, int(x),
+ row, y + lt->first_y, cleared);
if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
lt->need_break_row = row;
- if (lt->fullRebreak(bv)) {
- lt->setCursor(bv, lt->cursor.par(),lt->cursor.pos());
- if (lt->selection.set()) {
- lt->setCursor(bv, lt->selection.start,
- lt->selection.start.par(),
- lt->selection.start.pos());
- lt->setCursor(bv, lt->selection.end,
- lt->selection.end.par(),
- lt->selection.end.pos());
- }
+ lt->fullRebreak(bv);
+ lt->setCursor(bv, lt->cursor.par(),
+ lt->cursor.pos());
+ if (lt->selection.set()) {
+ lt->setCursor(bv, lt->selection.start,
+ lt->selection.start.par(),
+ lt->selection.start.pos());
+ lt->setCursor(bv, lt->selection.end,
+ lt->selection.end.par(),
+ lt->selection.end.pos());
}
break;
}
///
void insertInset(BufferView *, Inset * inset);
- /** Completes the insertion with a full rebreak.
- Returns true if something was broken. */
- bool fullRebreak(BufferView *);
+ /** Completes the insertion with a full rebreak. */
+ void fullRebreak(BufferView *);
///
mutable Row * need_break_row;
x_offset, row, y + text->first_y);
internal = internal && (st != LyXText::CHANGED_IN_DRAW);
while (internal && text->status() == LyXText::CHANGED_IN_DRAW) {
- if (text->fullRebreak(bv)) {
- st = LyXText::NEED_MORE_REFRESH;
- text->setCursor(bv, text->cursor.par(), text->cursor.pos());
- }
+ text->fullRebreak(bv);
+ st = LyXText::NEED_MORE_REFRESH;
+ text->setCursor(bv, text->cursor.par(),
+ text->cursor.pos());
text->status(bv, st);
text->getVisibleRow(bv, y + y_offset,
x_offset, row, y + text->first_y);
+2002-05-02 Lars Gullik Bjønnes <larsbj@birdstep.com>
+
+ * lyxstring.C (operator>>): try a new version of the operator>>
+
2002-04-14 Herbert Voss <voss@perce.de>
* lstrings.[Ch]: move the getVectorFromString and the vice versa
2002-04-08 Herbert Voss <voss@perce.de>
- * filetools.C (getExtFromContents): get tgif run
+ * filetools.C (getExtFromContents): get tgif run
2002-04-08 Angus Leeming <a.leeming@ic.ac.uk>
break;
}
- std::getline(ifs, str);
+ getline(ifs, str);
lyxerr[Debug::GRAPHICS] << "Scanstring: " << str << endl;
string const stamp = str.substr(0,2);
format = "xwd";
}
}
-
+
firstLine = false;
}
// end of the file. Than we have in the header:
// %%BoundingBox: (atend)
// In this case we must check the end.
- string const file_ = zippedFile(file) ?
+ string const file_ = zippedFile(file) ?
string(unzipFile(file)) : string(file);
string const format = getExtFromContents(file_);
if (format != "eps" && format != "ps")
std::ifstream is(file_.c_str());
while (is) {
string s;
- std::getline(is,s);
- if (contains(s,"%%BoundingBox:") && !contains(s,"atend"))
+ getline(is,s);
+ if (contains(s,"%%BoundingBox:") && !contains(s,"atend"))
return (frontStrip(s.substr(14)));
}
return string();
}
-
#include <iostream>
+#if 0
istream & operator>>(istream & is, lyxstring & s)
{
-#if 0
- // very bad solution
- char * nome = new char[1024];
- is >> nome;
- lyxstring tmp(nome);
- delete [] nome;
- if (!tmp.empty()) s = tmp;
-#else
// better solution
int w = is.width(0);
s.clear();
if (--w == 1) break;
}
if (s.empty()) is.setstate(std::ios::failbit);
-#endif
return is;
}
+#else
+istream & operator>>(istream & is, lyxstring & str)
+{
+ typedef istream istream_type;
+ typedef int int_type;
+ typedef std::streambuf streambuf_type;
+ typedef string string_type;
+ typedef string::size_type size_type;
+ size_type extracted = 0;
+
+// istream_type::sentry cerb(is, false);
+// if (cerb) {
+ str.erase();
+ std::streamsize w = is.width();
+ size_type n;
+ n = w > 0 ? static_cast<size_type>(w) : str.max_size();
+
+ int_type const eof = EOF;
+ streambuf_type * sb = is.rdbuf();
+ int_type c = sb->sgetc();
+
+ while (extracted < n
+ && c != eof && !isspace(c)) {
+ str += c;
+ ++extracted;
+ c = sb->snextc();
+ }
+ if (c == eof)
+ is.setstate(std::ios::eofbit);
+ is.width(0);
+// }
+ if (!extracted)
+ is.setstate(std::ios::failbit);
+ return is;
+}
+#endif
ostream & operator<<(ostream & o, lyxstring const & s)
}
-bool LyXText::fullRebreak(BufferView * bview)
+void LyXText::fullRebreak(BufferView * bview)
{
if (!firstrow) {
init(bview);
- return true;
+ return;
}
if (need_break_row) {
breakAgain(bview, need_break_row);
need_break_row = 0;
- return true;
+ return;
}
- return true;
}