keep selection after font change (John), fix positionning of error insets after environments (Ben), fix drawing of negative lengths and deletion of double spaces in single paragraph (me)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3188 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2001-12-11 14:33:52 +00:00
parent b7453a740b
commit 574031d689
5 changed files with 48 additions and 21 deletions

View File

@ -1,3 +1,19 @@
2001-12-11 Ben Stanley <bds02@uow.edu.au>
* paragraph.C: fixed missing line number count when exporting
Environments to LaTeX file
* buffer.C: added informational message for checking line numbers.
2001-12-11 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* text2.C (deleteEmptyParagraphMechanism): if there is only one
paragraph, do the 'double space' part, but not the 'empty
paragraph' one.
* text.C (workWidth): small optimization
(getLengthMarkerHeight): use minimal size for negative lengths.
2001-12-11 Dekel Tsur <dekelts@tau.ac.il>
* lyxfont.C (GUIFamilyNames): Fix GUIFamilyNames array
@ -9,6 +25,10 @@
* FontLoader.C:
* lyxfont.[Ch]: support for fraktur font used by \mathfrak
2001-12-06 John Levon <moz@compsoc.man.ac.uk>
* text2.C: keep selection on a setFont()
2001-12-06 John Levon <moz@compsoc.man.ac.uk>
* lyx_cb.C: another bv->text misuse, from insert label

View File

@ -2449,6 +2449,7 @@ void Buffer::makeLaTeXFile(string const & fname,
}
lyxerr[Debug::INFO] << "Finished making latex file." << endl;
lyxerr[Debug::INFO] << "Row count was " << texrow.rows()-1 << "." << endl;
}

View File

@ -1830,6 +1830,7 @@ Paragraph * Paragraph::TeXEnvironment(Buffer const * buf,
if (style.isEnvironment()) {
os << "\\end{" << style.latexname() << "}\n";
texrow.newline();
}
lyxerr[Debug::LATEX] << "TeXEnvironment...done " << par << endl;

View File

@ -72,8 +72,8 @@ int LyXText::workWidth(BufferView * bview, Inset * inset) const
pos_type pos = 0;
Buffer::inset_iterator it = bview->buffer()->inset_iterator_begin();
for (; it != bview->buffer()->inset_iterator_end(); ++it) {
Buffer::inset_iterator end = bview->buffer()->inset_iterator_end();
for ( ; it != end; ++it) {
if (*it == inset) {
par = it.getPar();
pos = it.getPos();
@ -3160,12 +3160,12 @@ void LyXText::paintRowDepthBar(DrawRowParams & p)
int LyXText::getLengthMarkerHeight(BufferView * bv, VSpace const & vsp) const
{
if (vsp.kind() != VSpace::LENGTH) {
return int(vsp.inPixels(bv));
}
int const space_size = int(vsp.inPixels(bv));
int const arrow_size = 4;
int const space_size = int(vsp.inPixels(bv));
if (vsp.kind() != VSpace::LENGTH) {
return space_size;
}
LyXFont font;
font.decSize();
@ -3173,7 +3173,10 @@ int LyXText::getLengthMarkerHeight(BufferView * bv, VSpace const & vsp) const
lyxfont::maxAscent(font)
+ lyxfont::maxDescent(font));
return std::max(min_size, space_size);
if (vsp.length().len().value() < 0.0)
return min_size;
else
return std::max(min_size, space_size);
}

View File

@ -790,11 +790,11 @@ void LyXText::setFont(BufferView * bview, LyXFont const & font, bool toggleall)
redoParagraphs(bview, selection.start, selection.end.par()->next());
// we have to reset the selection, because the
// geometry could have changed
// geometry could have changed, but we keep
// it for user convenience
setCursor(bview, selection.start.par(), selection.start.pos());
selection.cursor = cursor;
setCursor(bview, selection.end.par(), selection.end.pos());
clearSelection();
setSelection(bview);
setCursor(bview, tmpcursor.par(), tmpcursor.pos(), true,
tmpcursor.boundary());
@ -874,7 +874,7 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
y -= tmprow->height();
}
}
// we can set the refreshing parameters now
status(bview, LyXText::NEED_MORE_REFRESH);
refresh_y = y;
@ -888,11 +888,12 @@ void LyXText::redoParagraphs(BufferView * bview, LyXCursor const & cur,
tmppar = 0;
while (tmppar != endpar) {
removeRow(tmprow->next());
if (tmprow->next())
if (tmprow->next()) {
tmppar = tmprow->next()->par();
else
} else {
tmppar = 0;
}
}
}
// remove the first one
tmprow2 = tmprow; /* this is because tmprow->previous()
@ -2369,17 +2370,13 @@ void LyXText::fixCursorAfterDelete(BufferView * bview,
void LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
LyXCursor const & old_cursor) const
{
// don't delete anything if this is the ONLY paragraph!
if (!old_cursor.par()->next() && !old_cursor.par()->previous())
return;
// Would be wrong to delete anything if we have a selection.
if (selection.set()) return;
// We allow all kinds of "mumbo-jumbo" when freespacing.
if (textclasslist.Style(bview->buffer()->params.textclass,
old_cursor.par()->getLayout()).free_spacing ||
old_cursor.par()->isFreeSpacing())
old_cursor.par()->getLayout()).free_spacing
|| old_cursor.par()->isFreeSpacing())
{
return;
}
@ -2410,7 +2407,8 @@ void LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
// MISSING
// If the pos around the old_cursor were spaces, delete one of them.
if (old_cursor.par() != cursor.par() || old_cursor.pos() != cursor.pos()) {
if (old_cursor.par() != cursor.par()
|| old_cursor.pos() != cursor.pos()) {
// Only if the cursor has really moved
if (old_cursor.pos() > 0
@ -2442,6 +2440,10 @@ void LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
}
}
// don't delete anything if this is the ONLY paragraph!
if (!old_cursor.par()->next() && !old_cursor.par()->previous())
return;
// Do not delete empty paragraphs with keepempty set.
if ((textclasslist.Style(bview->buffer()->params.textclass,
old_cursor.par()->getLayout())).keepempty)