mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 10:47:57 +00:00
fix bug 2146
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10645 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
94828848a5
commit
d0cb16c256
@ -1,3 +1,14 @@
|
|||||||
|
2005-12-02 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
|
* text2.C (makeFontEntriesLayoutSpecific): remove.
|
||||||
|
(setLayout): adapt.
|
||||||
|
|
||||||
|
* text.C (insertChar): remove bogus caching of fonts (did not do
|
||||||
|
anything).
|
||||||
|
|
||||||
|
* text2.C (LyXText): initialize current_font to ALL_INHERIT (was
|
||||||
|
ALL_SANE). (bug 2146)
|
||||||
|
|
||||||
2005-12-01 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
2005-12-01 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
* rowpainter.C (paintFirst): fix centering of
|
* rowpainter.C (paintFirst): fix centering of
|
||||||
|
@ -342,6 +342,8 @@ public:
|
|||||||
/// the current font
|
/// the current font
|
||||||
LyXFont real_current_font;
|
LyXFont real_current_font;
|
||||||
/// our buffer's default layout font. This is textclass specific
|
/// our buffer's default layout font. This is textclass specific
|
||||||
|
/* This is actually never initialized! Should be replaced by a
|
||||||
|
* defaultfont() method that looks at the textclass (easy). [JMarc]*/
|
||||||
LyXFont defaultfont_;
|
LyXFont defaultfont_;
|
||||||
///
|
///
|
||||||
int background_color_;
|
int background_color_;
|
||||||
@ -365,9 +367,6 @@ private:
|
|||||||
/// change on pit
|
/// change on pit
|
||||||
pit_type undoSpan(pit_type pit);
|
pit_type undoSpan(pit_type pit);
|
||||||
|
|
||||||
/// used in setlayout
|
|
||||||
void makeFontEntriesLayoutSpecific(BufferParams const &, Paragraph & par);
|
|
||||||
|
|
||||||
/// Calculate and set the height of the row
|
/// Calculate and set the height of the row
|
||||||
void setHeightOfRow(pit_type, Row & row);
|
void setHeightOfRow(pit_type, Row & row);
|
||||||
|
|
||||||
|
15
src/text.C
15
src/text.C
@ -1154,16 +1154,6 @@ void LyXText::insertChar(LCursor & cur, char c)
|
|||||||
// difference are the special checks when calculating the row.fill
|
// difference are the special checks when calculating the row.fill
|
||||||
// (blank does not count at the end of a row) and the check here
|
// (blank does not count at the end of a row) and the check here
|
||||||
|
|
||||||
// The bug is triggered when we type in a description environment:
|
|
||||||
// The current_font is not changed when we go from label to main text
|
|
||||||
// and it should (along with realtmpfont) when we type the space.
|
|
||||||
// CHECK There is a bug here! (Asger)
|
|
||||||
|
|
||||||
// store the current font. This is because of the use of cursor
|
|
||||||
// movements. The moving cursor would refresh the current font
|
|
||||||
LyXFont realtmpfont = real_current_font;
|
|
||||||
LyXFont rawtmpfont = current_font;
|
|
||||||
|
|
||||||
// When the free-spacing option is set for the current layout,
|
// When the free-spacing option is set for the current layout,
|
||||||
// disable the double-space checking
|
// disable the double-space checking
|
||||||
if (!freeSpacing && IsLineSeparatorChar(c)) {
|
if (!freeSpacing && IsLineSeparatorChar(c)) {
|
||||||
@ -1190,10 +1180,7 @@ void LyXText::insertChar(LCursor & cur, char c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
par.insertChar(cur.pos(), c, rawtmpfont);
|
par.insertChar(cur.pos(), c, current_font);
|
||||||
|
|
||||||
current_font = rawtmpfont;
|
|
||||||
real_current_font = realtmpfont;
|
|
||||||
setCursor(cur, cur.pit(), cur.pos() + 1, false, cur.boundary());
|
setCursor(cur, cur.pit(), cur.pos() + 1, false, cur.boundary());
|
||||||
charInserted();
|
charInserted();
|
||||||
}
|
}
|
||||||
|
24
src/text2.C
24
src/text2.C
@ -68,6 +68,7 @@ using std::min;
|
|||||||
|
|
||||||
LyXText::LyXText(BufferView * bv)
|
LyXText::LyXText(BufferView * bv)
|
||||||
: maxwidth_(bv ? bv->workWidth() : 100),
|
: maxwidth_(bv ? bv->workWidth() : 100),
|
||||||
|
current_font(LyXFont::ALL_INHERIT),
|
||||||
background_color_(LColor::background),
|
background_color_(LColor::background),
|
||||||
bv_owner(bv),
|
bv_owner(bv),
|
||||||
autoBreakRows_(false)
|
autoBreakRows_(false)
|
||||||
@ -277,28 +278,6 @@ void LyXText::setCharFont(pit_type pit, pos_type pos, LyXFont const & fnt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// used in setLayout
|
|
||||||
// Asger is not sure we want to do this...
|
|
||||||
void LyXText::makeFontEntriesLayoutSpecific(BufferParams const & params,
|
|
||||||
Paragraph & par)
|
|
||||||
{
|
|
||||||
LyXLayout_ptr const & layout = par.layout();
|
|
||||||
pos_type const psize = par.size();
|
|
||||||
|
|
||||||
LyXFont layoutfont;
|
|
||||||
for (pos_type pos = 0; pos < psize; ++pos) {
|
|
||||||
if (pos < par.beginOfBody())
|
|
||||||
layoutfont = layout->labelfont;
|
|
||||||
else
|
|
||||||
layoutfont = layout->font;
|
|
||||||
|
|
||||||
LyXFont tmpfont = par.getFontSettings(params, pos);
|
|
||||||
tmpfont.reduce(layoutfont);
|
|
||||||
par.setFont(pos, tmpfont);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// return past-the-last paragraph influenced by a layout change on pit
|
// return past-the-last paragraph influenced by a layout change on pit
|
||||||
pit_type LyXText::undoSpan(pit_type pit)
|
pit_type LyXText::undoSpan(pit_type pit)
|
||||||
{
|
{
|
||||||
@ -327,7 +306,6 @@ void LyXText::setLayout(pit_type start, pit_type end, string const & layout)
|
|||||||
|
|
||||||
for (pit_type pit = start; pit != end; ++pit) {
|
for (pit_type pit = start; pit != end; ++pit) {
|
||||||
pars_[pit].applyLayout(lyxlayout);
|
pars_[pit].applyLayout(lyxlayout);
|
||||||
makeFontEntriesLayoutSpecific(bufparams, pars_[pit]);
|
|
||||||
if (lyxlayout->margintype == MARGIN_MANUAL)
|
if (lyxlayout->margintype == MARGIN_MANUAL)
|
||||||
pars_[pit].setLabelWidthString(lyxlayout->labelstring());
|
pars_[pit].setLabelWidthString(lyxlayout->labelstring());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user