mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-18 21:45:24 +00:00
- tex2lyx/text.cpp: correct font size handling also for branch, fixes bug 4807
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@24558 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
9f5ca02dc4
commit
911105f298
@ -1539,23 +1539,45 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
|
||||
eat_whitespace(p, os, context, true);
|
||||
}
|
||||
|
||||
// Starred section headings
|
||||
// Must attempt to parse "Section*" before "Section".
|
||||
else if ((p.next_token().asInput() == "*") &&
|
||||
context.new_layout_allowed &&
|
||||
// The single '=' is meant here.
|
||||
(newlayout = findLayout(context.textclass,
|
||||
t.cs() + '*')).get() &&
|
||||
newlayout->isCommand()) {
|
||||
TeXFont const oldFont = context.font;
|
||||
// save the current font size
|
||||
string const size = oldFont.size;
|
||||
// reset the font size to default, because the font size switches don't
|
||||
// affect section headings and the like
|
||||
context.font.size = known_coded_sizes[0];
|
||||
output_font_change(os, oldFont, context.font);
|
||||
// write the layout
|
||||
p.get_token();
|
||||
output_command_layout(os, p, outer, context, newlayout);
|
||||
// set the font size to the original value
|
||||
context.font.size = size;
|
||||
output_font_change(os, oldFont, context.font);
|
||||
p.skip_spaces();
|
||||
}
|
||||
|
||||
// The single '=' is meant here.
|
||||
// Section headings and the like
|
||||
else if (context.new_layout_allowed &&
|
||||
(newlayout = findLayout(context.textclass, t.cs())).get() &&
|
||||
newlayout->isCommand()) {
|
||||
TeXFont const oldFont = context.font;
|
||||
// save the current font size
|
||||
string const size = oldFont.size;
|
||||
// reset the font size to default, because the font size switches don't
|
||||
// affect section headings and the like
|
||||
context.font.size = known_coded_sizes[0];
|
||||
output_font_change(os, oldFont, context.font);
|
||||
// write the layout
|
||||
output_command_layout(os, p, outer, context, newlayout);
|
||||
// set the font size to the original value
|
||||
context.font.size = size;
|
||||
output_font_change(os, oldFont, context.font);
|
||||
p.skip_spaces();
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ What's new
|
||||
- Import global paragraph settings correctly when importing LaTeX files
|
||||
(bug 4773).
|
||||
|
||||
- Fix the font size handling when importing LaTeX files (bug 4803).
|
||||
- Fix font size handling when importing LaTeX files (bug 4803 and bug 4807).
|
||||
|
||||
|
||||
* USER INTERFACE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user