mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Two patches from Dekel (\\protect and depth bars); remove ! for margin notes; fixes to the 'use AMS math' feature
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@717 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5e79e0d5c6
commit
8c818bc598
33
ChangeLog
33
ChangeLog
@ -1,3 +1,36 @@
|
|||||||
|
2000-05-05 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||||
|
|
||||||
|
* src/text.C (draw): do not display an exclamation mark in the
|
||||||
|
margin for margin notes. This is confusing, ugly and
|
||||||
|
uninformative.
|
||||||
|
|
||||||
|
* src/LaTeXFeatures.C (getPackages): load amssymb also when 'Use
|
||||||
|
AMS math' is checked.
|
||||||
|
|
||||||
|
* src/buffer.C (makeLaTeXFile): do not depend on the textclass
|
||||||
|
name to see whether including the amsmath package is needed.
|
||||||
|
|
||||||
|
2000-05-05 Dekel Tsur <dekel@math.tau.ac.il>
|
||||||
|
|
||||||
|
* src/paragraph.C (validate): Compute UsedLanguages correctly
|
||||||
|
(don't insert the american language if it doesn't appear in the
|
||||||
|
document)
|
||||||
|
|
||||||
|
* src/paragraph.C (TeXOnePar,SimpleTeXOnePar,SimpleTeXSpecialChars)
|
||||||
|
The argument of \thanks{} command is considered moving argument
|
||||||
|
|
||||||
|
* src/paragraph.C (SimpleTeXOnePar): Put \protect before \\ if in
|
||||||
|
moving argument.
|
||||||
|
|
||||||
|
2000-05-04 Dekel Tsur <dekel@math.tau.ac.il>
|
||||||
|
|
||||||
|
* src/text.C (GetVisibleRow): Improved drawing of vertical lines
|
||||||
|
for appendix/minipage/depth. The lines can be now both in the footnote
|
||||||
|
frame, and outside the frame.
|
||||||
|
|
||||||
|
* src/text.C (SingleWidth,draw): Correct rendering of Hebrew vowels
|
||||||
|
points ("nikud")
|
||||||
|
|
||||||
2000-05-05 Juergen Vigna <jug@sad.it>
|
2000-05-05 Juergen Vigna <jug@sad.it>
|
||||||
|
|
||||||
* src/table.[Ch]: removed the inset and buffer stuff as this is now
|
* src/table.[Ch]: removed the inset and buffer stuff as this is now
|
||||||
|
11
NEWS
11
NEWS
@ -13,7 +13,10 @@ User-visible changes:
|
|||||||
- Right-to-Left support for Hebrew and Arabic, this is a first attempt
|
- Right-to-Left support for Hebrew and Arabic, this is a first attempt
|
||||||
only and is likely to improve in future versions.
|
only and is likely to improve in future versions.
|
||||||
|
|
||||||
- Per-paragraph spacing, currently only settable wrom the
|
- New visual feedback for environment depth of paragraphs (also the !
|
||||||
|
in the margin for margin notes has been removed).
|
||||||
|
|
||||||
|
- Per-paragraph spacing, currently only settable from the
|
||||||
command-line/window:
|
command-line/window:
|
||||||
paragraph-spacing (default,single,onehalf,double,other) [float]
|
paragraph-spacing (default,single,onehalf,double,other) [float]
|
||||||
|
|
||||||
@ -30,7 +33,7 @@ User-visible changes:
|
|||||||
|
|
||||||
- Removed support for XForms older than 0.88.
|
- Removed support for XForms older than 0.88.
|
||||||
|
|
||||||
- Some commandline options and X resources are not supported anymore
|
- Some command-line options and X resources are not supported anymore
|
||||||
(The color ones, and -mono -fastselection, -reverse)
|
(The color ones, and -mono -fastselection, -reverse)
|
||||||
|
|
||||||
- new lyxrc variables: \show_banner [true|false] to remove the banner
|
- new lyxrc variables: \show_banner [true|false] to remove the banner
|
||||||
@ -57,8 +60,8 @@ In the user-visible department, we find:
|
|||||||
|
|
||||||
- better placement of accents for characters that LyX draws by itself;
|
- better placement of accents for characters that LyX draws by itself;
|
||||||
|
|
||||||
- improved translations, in particular in finnish (overhauled UI
|
- improved translations, in particular in Finnish (overhauled UI
|
||||||
translation), dutch (tutorial and examples), german
|
translation), Dutch (tutorial and examples), German
|
||||||
|
|
||||||
- new configure flag --with-lyxname which allows to choose the name
|
- new configure flag --with-lyxname which allows to choose the name
|
||||||
under which lyx is installed. Default is "lyx", of course. It used
|
under which lyx is installed. Default is "lyx", of course. It used
|
||||||
|
@ -158,7 +158,7 @@ string LaTeXFeatures::getPackages()
|
|||||||
packages += "\\usepackage{rotating}\n";
|
packages += "\\usepackage{rotating}\n";
|
||||||
|
|
||||||
// amssymb.sty
|
// amssymb.sty
|
||||||
if (amssymb)
|
if (amssymb || params.use_amsmath)
|
||||||
packages += "\\usepackage{amssymb}\n";
|
packages += "\\usepackage{amssymb}\n";
|
||||||
|
|
||||||
// latexsym.sty
|
// latexsym.sty
|
||||||
|
@ -1739,11 +1739,8 @@ void Buffer::makeLaTeXFile(string const & fname,
|
|||||||
use_babel = true;
|
use_babel = true;
|
||||||
for (LaTeXFeatures::LanguageList::const_iterator cit =
|
for (LaTeXFeatures::LanguageList::const_iterator cit =
|
||||||
features.UsedLanguages.begin();
|
features.UsedLanguages.begin();
|
||||||
cit != features.UsedLanguages.end(); ++cit) {
|
cit != features.UsedLanguages.end(); ++cit)
|
||||||
options += (*cit)->lang + ",";
|
options += (*cit)->lang + ",";
|
||||||
}
|
|
||||||
if (default_language != params.language_info)
|
|
||||||
options += default_language->lang + ',';
|
|
||||||
options += params.language_info->lang + ',';
|
options += params.language_info->lang + ',';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1884,7 +1881,7 @@ void Buffer::makeLaTeXFile(string const & fname,
|
|||||||
texrow.newline();
|
texrow.newline();
|
||||||
}
|
}
|
||||||
if (params.use_amsmath
|
if (params.use_amsmath
|
||||||
&& !prefixIs(textclasslist.LatexnameOfClass(params.textclass), "ams")) {
|
&& !tclass.provides(LyXTextClass::amsmath)) {
|
||||||
ofs << "\\usepackage{amsmath}\n";
|
ofs << "\\usepackage{amsmath}\n";
|
||||||
texrow.newline();
|
texrow.newline();
|
||||||
}
|
}
|
||||||
@ -2128,7 +2125,7 @@ void Buffer::latexParagraphs(ostream & ofs, LyXParagraph *par,
|
|||||||
par = par->TeXEnvironment(ofs, texrow,
|
par = par->TeXEnvironment(ofs, texrow,
|
||||||
ftnote, ft_texrow, ftcount);
|
ftnote, ft_texrow, ftcount);
|
||||||
} else {
|
} else {
|
||||||
par = par->TeXOnePar(ofs, texrow,
|
par = par->TeXOnePar(ofs, texrow, false,
|
||||||
ftnote, ft_texrow, ftcount);
|
ftnote, ft_texrow, ftcount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -152,10 +152,11 @@ public:
|
|||||||
|
|
||||||
///
|
///
|
||||||
LyXParagraph * TeXOnePar(std::ostream &, TexRow & texrow,
|
LyXParagraph * TeXOnePar(std::ostream &, TexRow & texrow,
|
||||||
|
bool moving_arg,
|
||||||
std::ostream & foot, TexRow & foot_texrow,
|
std::ostream & foot, TexRow & foot_texrow,
|
||||||
int & foot_count);
|
int & foot_count);
|
||||||
///
|
///
|
||||||
bool SimpleTeXOnePar(std::ostream &, TexRow & texrow);
|
bool SimpleTeXOnePar(std::ostream &, TexRow & texrow, bool moving_arg);
|
||||||
|
|
||||||
///
|
///
|
||||||
LyXParagraph * TeXEnvironment(std::ostream &, TexRow & texrow,
|
LyXParagraph * TeXEnvironment(std::ostream &, TexRow & texrow,
|
||||||
@ -590,6 +591,7 @@ private:
|
|||||||
LyXLayout const & style);
|
LyXLayout const & style);
|
||||||
///
|
///
|
||||||
void SimpleTeXSpecialChars(std::ostream &, TexRow & texrow,
|
void SimpleTeXSpecialChars(std::ostream &, TexRow & texrow,
|
||||||
|
bool moving_arg,
|
||||||
LyXFont & font, LyXFont & running_font,
|
LyXFont & font, LyXFont & running_font,
|
||||||
LyXFont & basefont, bool & open_font,
|
LyXFont & basefont, bool & open_font,
|
||||||
LyXLayout const & style,
|
LyXLayout const & style,
|
||||||
|
@ -367,12 +367,22 @@ void LyXParagraph::validate(LaTeXFeatures & features) const
|
|||||||
<< (*cit).font.stateText()
|
<< (*cit).font.stateText()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
Language const * language = (*cit).font.language();
|
Language const * language = (*cit).font.language();
|
||||||
if (language != doc_language && language != default_language) {
|
if (language != doc_language) {
|
||||||
features.UsedLanguages.insert(language);
|
features.UsedLanguages.insert(language);
|
||||||
lyxerr[Debug::LATEX] << "Found language "
|
lyxerr[Debug::LATEX] << "Found language "
|
||||||
<< language->lang << endl;
|
<< language->lang << endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is not efficient. I plan to use the code above, after I
|
||||||
|
// change the fontlist handling.
|
||||||
|
for (size_type i = 0; i < size(); ++i) {
|
||||||
|
Language const * language = GetFontSettings(i).language();
|
||||||
|
if (language != doc_language)
|
||||||
|
features.UsedLanguages.insert(language);
|
||||||
}
|
}
|
||||||
|
|
||||||
// then the insets
|
// then the insets
|
||||||
@ -1964,6 +1974,7 @@ int LyXParagraph::GetPositionOfInset(Inset * inset) const
|
|||||||
|
|
||||||
|
|
||||||
LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
|
LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
|
||||||
|
bool moving_arg,
|
||||||
ostream & foot,
|
ostream & foot,
|
||||||
TexRow & foot_texrow,
|
TexRow & foot_texrow,
|
||||||
int & foot_count)
|
int & foot_count)
|
||||||
@ -2041,7 +2052,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool need_par = SimpleTeXOnePar(os, texrow);
|
bool need_par = SimpleTeXOnePar(os, texrow, moving_arg);
|
||||||
|
|
||||||
// Spit out footnotes
|
// Spit out footnotes
|
||||||
LyXParagraph * par = next;
|
LyXParagraph * par = next;
|
||||||
@ -2059,7 +2070,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
|
|||||||
par = par->TeXFootnote(os, texrow, foot,
|
par = par->TeXFootnote(os, texrow, foot,
|
||||||
foot_texrow, foot_count,
|
foot_texrow, foot_count,
|
||||||
is_rtl);
|
is_rtl);
|
||||||
par->SimpleTeXOnePar(os, texrow);
|
par->SimpleTeXOnePar(os, texrow, moving_arg);
|
||||||
is_rtl = par->GetFontSettings(par->size()-1).isRightToLeft();
|
is_rtl = par->GetFontSettings(par->size()-1).isRightToLeft();
|
||||||
if (par->next &&
|
if (par->next &&
|
||||||
par->next->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
|
par->next->footnoteflag != LyXParagraph::NO_FOOTNOTE &&
|
||||||
@ -2075,7 +2086,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
|
|||||||
par = par->TeXFootnote(os, texrow,
|
par = par->TeXFootnote(os, texrow,
|
||||||
foot, foot_texrow, foot_count,
|
foot, foot_texrow, foot_count,
|
||||||
false);
|
false);
|
||||||
par->SimpleTeXOnePar(os, texrow);
|
par->SimpleTeXOnePar(os, texrow, moving_arg);
|
||||||
par = par->next;
|
par = par->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2184,7 +2195,8 @@ LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
|
|||||||
|
|
||||||
|
|
||||||
// This one spits out the text of the paragraph
|
// This one spits out the text of the paragraph
|
||||||
bool LyXParagraph::SimpleTeXOnePar(ostream & os, TexRow & texrow)
|
bool LyXParagraph::SimpleTeXOnePar(ostream & os, TexRow & texrow,
|
||||||
|
bool moving_arg)
|
||||||
{
|
{
|
||||||
lyxerr[Debug::LATEX] << "SimpleTeXOnePar... " << this << endl;
|
lyxerr[Debug::LATEX] << "SimpleTeXOnePar... " << this << endl;
|
||||||
|
|
||||||
@ -2227,6 +2239,8 @@ bool LyXParagraph::SimpleTeXOnePar(ostream & os, TexRow & texrow)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
moving_arg |= style.needprotect;
|
||||||
|
|
||||||
// Which font is currently active?
|
// Which font is currently active?
|
||||||
LyXFont running_font(basefont);
|
LyXFont running_font(basefont);
|
||||||
// Do we have an open font change?
|
// Do we have an open font change?
|
||||||
@ -2356,13 +2370,15 @@ bool LyXParagraph::SimpleTeXOnePar(ostream & os, TexRow & texrow)
|
|||||||
LyXFont::TYPEWRITER_FAMILY) {
|
LyXFont::TYPEWRITER_FAMILY) {
|
||||||
os << "~";
|
os << "~";
|
||||||
}
|
}
|
||||||
|
if (moving_arg)
|
||||||
|
os << "\\protect ";
|
||||||
os << "\\\\\n";
|
os << "\\\\\n";
|
||||||
}
|
}
|
||||||
texrow.newline();
|
texrow.newline();
|
||||||
texrow.start(this, i + 1);
|
texrow.start(this, i + 1);
|
||||||
column = 0;
|
column = 0;
|
||||||
} else {
|
} else {
|
||||||
SimpleTeXSpecialChars(os, texrow,
|
SimpleTeXSpecialChars(os, texrow, moving_arg,
|
||||||
font, running_font, basefont,
|
font, running_font, basefont,
|
||||||
open_font, style, i, column, c);
|
open_font, style, i, column, c);
|
||||||
}
|
}
|
||||||
@ -2549,7 +2565,7 @@ bool LyXParagraph::SimpleTeXOneTablePar(ostream & os, TexRow & texrow)
|
|||||||
}
|
}
|
||||||
texrow.start(this, i + 1);
|
texrow.start(this, i + 1);
|
||||||
} else {
|
} else {
|
||||||
SimpleTeXSpecialChars(os, texrow,
|
SimpleTeXSpecialChars(os, texrow, false,
|
||||||
font, running_font, basefont,
|
font, running_font, basefont,
|
||||||
open_font, style, i, column, c);
|
open_font, style, i, column, c);
|
||||||
}
|
}
|
||||||
@ -2661,7 +2677,7 @@ bool LyXParagraph::TeXContTableRows(ostream & os,
|
|||||||
column += 9;
|
column += 9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SimpleTeXSpecialChars(os, texrow, font,
|
SimpleTeXSpecialChars(os, texrow, false, font,
|
||||||
running_font, basefont,
|
running_font, basefont,
|
||||||
open_font, style, i, column, c);
|
open_font, style, i, column, c);
|
||||||
}
|
}
|
||||||
@ -3110,6 +3126,7 @@ void LyXParagraph::SimpleTeXBlanks(ostream & os, TexRow & texrow,
|
|||||||
|
|
||||||
|
|
||||||
void LyXParagraph::SimpleTeXSpecialChars(ostream & os, TexRow & texrow,
|
void LyXParagraph::SimpleTeXSpecialChars(ostream & os, TexRow & texrow,
|
||||||
|
bool moving_arg,
|
||||||
LyXFont & font,
|
LyXFont & font,
|
||||||
LyXFont & running_font,
|
LyXFont & running_font,
|
||||||
LyXFont & basefont,
|
LyXFont & basefont,
|
||||||
@ -3135,7 +3152,7 @@ void LyXParagraph::SimpleTeXSpecialChars(ostream & os, TexRow & texrow,
|
|||||||
close = true;
|
close = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tmp = inset->Latex(os, style.isCommand(),
|
int tmp = inset->Latex(os, moving_arg,
|
||||||
style.free_spacing);
|
style.free_spacing);
|
||||||
|
|
||||||
if (close)
|
if (close)
|
||||||
@ -3472,7 +3489,7 @@ LyXParagraph * LyXParagraph::TeXDeeper(ostream & os, TexRow & texrow,
|
|||||||
foot, foot_texrow,
|
foot, foot_texrow,
|
||||||
foot_count);
|
foot_count);
|
||||||
} else {
|
} else {
|
||||||
par = par->TeXOnePar(os, texrow,
|
par = par->TeXOnePar(os, texrow, false,
|
||||||
foot, foot_texrow,
|
foot, foot_texrow,
|
||||||
foot_count);
|
foot_count);
|
||||||
}
|
}
|
||||||
@ -3623,7 +3640,7 @@ LyXParagraph * LyXParagraph::TeXEnvironment(ostream & os, TexRow & texrow,
|
|||||||
}
|
}
|
||||||
LyXParagraph * par = this;
|
LyXParagraph * par = this;
|
||||||
do {
|
do {
|
||||||
par = par->TeXOnePar(os, texrow,
|
par = par->TeXOnePar(os, texrow, false,
|
||||||
foot, foot_texrow, foot_count);
|
foot, foot_texrow, foot_count);
|
||||||
|
|
||||||
if (minipage_open && par && !style.isEnvironment() &&
|
if (minipage_open && par && !style.isEnvironment() &&
|
||||||
@ -3807,8 +3824,10 @@ LyXParagraph * LyXParagraph::TeXFootnote(ostream & os, TexRow & texrow,
|
|||||||
texrow.newline();
|
texrow.newline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool moving_arg = false;
|
||||||
bool need_closing = false;
|
bool need_closing = false;
|
||||||
bool is_rtl = isRightToLeftPar();
|
bool is_rtl = isRightToLeftPar();
|
||||||
|
|
||||||
if (is_rtl != parent_is_rtl) {
|
if (is_rtl != parent_is_rtl) {
|
||||||
if (is_rtl)
|
if (is_rtl)
|
||||||
os << "\\R{";
|
os << "\\R{";
|
||||||
@ -3824,6 +3843,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(ostream & os, TexRow & texrow,
|
|||||||
if (style.intitle) {
|
if (style.intitle) {
|
||||||
os << "\\thanks{\n";
|
os << "\\thanks{\n";
|
||||||
footer_in_body = false;
|
footer_in_body = false;
|
||||||
|
moving_arg = true;
|
||||||
} else {
|
} else {
|
||||||
if (foot_count == -1) {
|
if (foot_count == -1) {
|
||||||
// we're at depth 0 so we can use:
|
// we're at depth 0 so we can use:
|
||||||
@ -3918,7 +3938,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(ostream & os, TexRow & texrow,
|
|||||||
foot, foot_texrow,
|
foot, foot_texrow,
|
||||||
foot_count);
|
foot_count);
|
||||||
} else {
|
} else {
|
||||||
par = par->TeXOnePar(os, texrow,
|
par = par->TeXOnePar(os, texrow, moving_arg,
|
||||||
foot, foot_texrow,
|
foot, foot_texrow,
|
||||||
foot_count);
|
foot_count);
|
||||||
}
|
}
|
||||||
@ -3960,6 +3980,7 @@ LyXParagraph * LyXParagraph::TeXFootnote(ostream & os, TexRow & texrow,
|
|||||||
dummy_count);
|
dummy_count);
|
||||||
} else {
|
} else {
|
||||||
par = par->TeXOnePar(foot, foot_texrow,
|
par = par->TeXOnePar(foot, foot_texrow,
|
||||||
|
moving_arg,
|
||||||
dummy, dummy_texrow,
|
dummy, dummy_texrow,
|
||||||
dummy_count);
|
dummy_count);
|
||||||
}
|
}
|
||||||
|
208
src/text.C
208
src/text.C
@ -101,12 +101,20 @@ static int iso885968x[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
bool is_arabic(unsigned char c)
|
bool is_arabic(unsigned char c)
|
||||||
{
|
{
|
||||||
return 0xa8 <= c && c <= 0xea && iso885968x[c-0xa8];
|
return 0xa8 <= c && c <= 0xea && iso885968x[c-0xa8];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool is_nikud(unsigned char c)
|
||||||
|
{
|
||||||
|
return 192 <= c && c <= 210;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned char LyXText::TransformChar(unsigned char c, Letter_Form form) const
|
unsigned char LyXText::TransformChar(unsigned char c, Letter_Form form) const
|
||||||
{
|
{
|
||||||
if (is_arabic(c) &&
|
if (is_arabic(c) &&
|
||||||
@ -179,9 +187,14 @@ int LyXText::SingleWidth(LyXParagraph * par,
|
|||||||
|
|
||||||
// The most common case is handled first (Asger)
|
// The most common case is handled first (Asger)
|
||||||
if (IsPrintable(c)) {
|
if (IsPrintable(c)) {
|
||||||
|
if (font.language()->RightToLeft) {
|
||||||
if (font.language()->lang == "arabic" &&
|
if (font.language()->lang == "arabic" &&
|
||||||
lyxrc.font_norm == "iso8859-6.8x")
|
lyxrc.font_norm == "iso8859-6.8x")
|
||||||
c = TransformChar(c, par, pos);
|
c = TransformChar(c, par, pos);
|
||||||
|
else if (font.language()->lang == "hebrew" &&
|
||||||
|
is_nikud(c))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return lyxfont::width(c, font);
|
return lyxfont::width(c, font);
|
||||||
|
|
||||||
} else if (IsHfillChar(c)) {
|
} else if (IsHfillChar(c)) {
|
||||||
@ -450,10 +463,15 @@ void LyXText::draw(Row const * row,
|
|||||||
switch (c) {
|
switch (c) {
|
||||||
case LyXParagraph::META_MARGIN:
|
case LyXParagraph::META_MARGIN:
|
||||||
fs = "margin";
|
fs = "margin";
|
||||||
|
#ifdef WITH_WARNINGS
|
||||||
|
#warning I think we do not need that '!' (JMarc)
|
||||||
|
#endif
|
||||||
|
#if 0
|
||||||
// Draw a sign at the left margin!
|
// Draw a sign at the left margin!
|
||||||
owner_->painter()
|
owner_->painter()
|
||||||
.text((LYX_PAPER_MARGIN - lyxfont::width('!', font))/2,
|
.text((LYX_PAPER_MARGIN - lyxfont::width('!', font))/2,
|
||||||
offset + row->baseline, "!", 1, font);
|
offset + row->baseline, "!", 1, font);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case LyXParagraph::META_FIG:
|
case LyXParagraph::META_FIG:
|
||||||
fs = "fig";
|
fs = "fig";
|
||||||
@ -518,31 +536,70 @@ void LyXText::draw(Row const * row,
|
|||||||
// So IMHO we should go with the easier and clearer implementation.
|
// So IMHO we should go with the easier and clearer implementation.
|
||||||
// And even if 1024 is a large number here it might overflow, string
|
// And even if 1024 is a large number here it might overflow, string
|
||||||
// will only overflow if the machine is out of memory...
|
// will only overflow if the machine is out of memory...
|
||||||
bool do_transform =
|
|
||||||
font2.language()->lang == "arabic" &&
|
|
||||||
lyxrc.font_norm == "iso8859-6.8x";
|
|
||||||
if (do_transform)
|
|
||||||
c = TransformChar(c, row->par, pos);
|
|
||||||
static string textstring;
|
static string textstring;
|
||||||
textstring = c;
|
textstring = c;
|
||||||
++vpos;
|
++vpos;
|
||||||
|
|
||||||
LyXParagraph::size_type last = RowLastPrintable(row);
|
LyXParagraph::size_type last = RowLastPrintable(row);
|
||||||
|
float tmpx = x;
|
||||||
|
|
||||||
|
if (font.language()->lang == "hebrew") {
|
||||||
|
if (is_nikud(c)) {
|
||||||
|
LyXParagraph::size_type vpos2 = vpos;
|
||||||
|
int width = lyxfont::width(c, font2);
|
||||||
|
int dx = 0;
|
||||||
|
while (vpos2 <= last &&
|
||||||
|
(pos = vis2log(vpos2)) >= 0
|
||||||
|
&& static_cast<unsigned char>(c = row->par->GetChar(pos)) > ' '
|
||||||
|
&& is_nikud(c))
|
||||||
|
++vpos2;
|
||||||
|
if (static_cast<unsigned char>(c = row->par->GetChar(pos)) > ' '
|
||||||
|
&& !is_nikud(c)) {
|
||||||
|
int width2 = SingleWidth(row->par, pos, c);
|
||||||
|
dx = (c == 'ø' || c == 'ã')
|
||||||
|
? width2-width : (width2-width)/2;
|
||||||
|
}
|
||||||
|
// Draw nikud
|
||||||
|
pain.text(int(x)+dx, offset + row->baseline, textstring, font);
|
||||||
|
} else {
|
||||||
|
while (vpos <= last &&
|
||||||
|
(pos = vis2log(vpos)) >= 0
|
||||||
|
&& static_cast<unsigned char>(c = row->par->GetChar(pos)) > ' '
|
||||||
|
&& !is_nikud(c)
|
||||||
|
&& font2 == GetFont(row->par, pos)) {
|
||||||
|
textstring += c;
|
||||||
|
++vpos;
|
||||||
|
}
|
||||||
|
// Draw text and set the new x position
|
||||||
|
pain.text(int(x), offset + row->baseline, textstring, font);
|
||||||
|
x += lyxfont::width(textstring, font);
|
||||||
|
}
|
||||||
|
} else if (font.language()->lang == "arabic" &&
|
||||||
|
lyxrc.font_norm == "iso8859-6.8x") {
|
||||||
|
textstring = TransformChar(c, row->par, pos);
|
||||||
while (vpos <= last &&
|
while (vpos <= last &&
|
||||||
(pos = vis2log(vpos)) >= 0
|
(pos = vis2log(vpos)) >= 0
|
||||||
&& static_cast<unsigned char>(c = row->par->GetChar(pos)) > ' '
|
&& static_cast<unsigned char>(c = row->par->GetChar(pos)) > ' '
|
||||||
&& font2 == GetFont(row->par, pos)) {
|
&& font2 == GetFont(row->par, pos)) {
|
||||||
if (do_transform)
|
|
||||||
c = TransformChar(c, row->par, pos);
|
c = TransformChar(c, row->par, pos);
|
||||||
textstring += c;
|
textstring += c;
|
||||||
++vpos;
|
++vpos;
|
||||||
}
|
}
|
||||||
float tmpx = x;
|
|
||||||
|
|
||||||
// Draw text and set the new x position
|
// Draw text and set the new x position
|
||||||
pain.text(int(x), offset + row->baseline, textstring, font);
|
pain.text(int(x), offset + row->baseline, textstring, font);
|
||||||
x += lyxfont::width(textstring, font);
|
x += lyxfont::width(textstring, font);
|
||||||
|
} else {
|
||||||
|
while (vpos <= last &&
|
||||||
|
(pos = vis2log(vpos)) >= 0
|
||||||
|
&& static_cast<unsigned char>(c = row->par->GetChar(pos)) > ' '
|
||||||
|
&& font2 == GetFont(row->par, pos)) {
|
||||||
|
textstring += c;
|
||||||
|
++vpos;
|
||||||
|
}
|
||||||
|
// Draw text and set the new x position
|
||||||
|
pain.text(int(x), offset + row->baseline, textstring, font);
|
||||||
|
x += lyxfont::width(textstring, font);
|
||||||
|
}
|
||||||
|
|
||||||
// what about underbars?
|
// what about underbars?
|
||||||
if (font.underbar() == LyXFont::ON && font.latex() != LyXFont::ON) {
|
if (font.underbar() == LyXFont::ON && font.latex() != LyXFont::ON) {
|
||||||
@ -3581,7 +3638,7 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
|
|||||||
float x, tmpx;
|
float x, tmpx;
|
||||||
int y_top, y_bottom;
|
int y_top, y_bottom;
|
||||||
float fill_separator, fill_hfill, fill_label_hfill;
|
float fill_separator, fill_hfill, fill_label_hfill;
|
||||||
LyXParagraph * par, * firstpar;
|
|
||||||
LyXFont font;
|
LyXFont font;
|
||||||
int maxdesc;
|
int maxdesc;
|
||||||
if (row_ptr->height <= 0) {
|
if (row_ptr->height <= 0) {
|
||||||
@ -3727,54 +3784,13 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row_ptr->par->appendix){
|
int box_x = 0;
|
||||||
pain.line(1, offset,
|
|
||||||
1, offset + row_ptr->height,
|
|
||||||
LColor::appendixline);
|
|
||||||
pain.line(paperwidth - 2, offset,
|
|
||||||
paperwidth - 2, offset + row_ptr->height,
|
|
||||||
LColor::appendixline);
|
|
||||||
}
|
|
||||||
|
|
||||||
int depth = row_ptr->par->GetDepth();
|
|
||||||
if (depth > 0) {
|
|
||||||
int next_depth = (row_ptr->next)
|
|
||||||
? next_depth = row_ptr->next->par->GetDepth() : 0;
|
|
||||||
int prev_depth = (row_ptr->previous)
|
|
||||||
? row_ptr->previous->par->GetDepth() : 0;
|
|
||||||
|
|
||||||
for (int i = 1; i <= depth; ++i)
|
|
||||||
pain.line(4*i, offset,
|
|
||||||
4*i, offset + row_ptr->height - 1 - (i-next_depth-1)*3,
|
|
||||||
LColor::depthbar);
|
|
||||||
|
|
||||||
for (int i = prev_depth + 1; i <= depth; ++i)
|
|
||||||
pain.fillRectangle(4*i, offset,
|
|
||||||
4, 2,
|
|
||||||
LColor::depthbar);
|
|
||||||
|
|
||||||
for (int i = next_depth + 1; i <= depth; ++i)
|
|
||||||
pain.fillRectangle(4*i, offset + row_ptr->height - 2 - (i-next_depth-1)*3,
|
|
||||||
4, 2,
|
|
||||||
LColor::depthbar);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (row_ptr->par->pextra_type == LyXParagraph::PEXTRA_MINIPAGE) {
|
|
||||||
/* draw a marker at the left margin! */
|
|
||||||
LyXFont font = GetFont(row_ptr->par, 0);
|
|
||||||
int asc = lyxfont::maxAscent(font);
|
|
||||||
int x = (LYX_PAPER_MARGIN - lyxfont::width('|', font)) / 2;
|
|
||||||
int y1 = (offset + row_ptr->baseline);
|
|
||||||
int y2 = (offset + row_ptr->baseline) - asc;
|
|
||||||
pain.line(x, y1, x, y2, LColor::minipageline);
|
|
||||||
}
|
|
||||||
if (row_ptr->par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
|
if (row_ptr->par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
|
||||||
LyXFont font(LyXFont::ALL_SANE);
|
LyXFont font(LyXFont::ALL_SANE);
|
||||||
font.setSize(LyXFont::SIZE_FOOTNOTE);
|
font.setSize(LyXFont::SIZE_FOOTNOTE);
|
||||||
font.setColor(LColor::footnote);
|
font.setColor(LColor::footnote);
|
||||||
|
|
||||||
int box_x = LYX_PAPER_MARGIN;
|
box_x = LYX_PAPER_MARGIN + lyxfont::width(" wide-tab ", font);
|
||||||
box_x += lyxfont::width(" wide-tab ", font);
|
|
||||||
if (row_ptr->previous &&
|
if (row_ptr->previous &&
|
||||||
row_ptr->previous->par->footnoteflag != LyXParagraph::OPEN_FOOTNOTE){
|
row_ptr->previous->par->footnoteflag != LyXParagraph::OPEN_FOOTNOTE){
|
||||||
string fs;
|
string fs;
|
||||||
@ -3843,6 +3859,35 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
|
|||||||
paperwidth - LYX_PAPER_MARGIN,
|
paperwidth - LYX_PAPER_MARGIN,
|
||||||
offset + row_ptr->height,
|
offset + row_ptr->height,
|
||||||
LColor::footnoteframe);
|
LColor::footnoteframe);
|
||||||
|
|
||||||
|
|
||||||
|
// Draw appendix lines
|
||||||
|
LyXParagraph * p = row_ptr->par->PreviousBeforeFootnote()->FirstPhysicalPar();
|
||||||
|
if (p->appendix){
|
||||||
|
pain.line(1, offset,
|
||||||
|
1, offset + row_ptr->height,
|
||||||
|
LColor::appendixline);
|
||||||
|
pain.line(paperwidth - 2, offset,
|
||||||
|
paperwidth - 2, offset + row_ptr->height,
|
||||||
|
LColor::appendixline);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw minipage line
|
||||||
|
bool minipage = p->pextra_type == LyXParagraph::PEXTRA_MINIPAGE;
|
||||||
|
if (minipage)
|
||||||
|
pain.line(LYX_PAPER_MARGIN/5, offset,
|
||||||
|
LYX_PAPER_MARGIN/5,
|
||||||
|
offset + row_ptr->height - 1,
|
||||||
|
LColor::minipageline);
|
||||||
|
|
||||||
|
// Draw depth lines
|
||||||
|
int depth = p->GetDepth();
|
||||||
|
for (int i = 1; i <= depth; ++i) {
|
||||||
|
int line_x = (LYX_PAPER_MARGIN/5)*(i+minipage);
|
||||||
|
pain.line(line_x, offset, line_x,
|
||||||
|
offset + row_ptr->height - 1,
|
||||||
|
LColor::depthbar);
|
||||||
|
}
|
||||||
} else if (row_ptr->previous &&
|
} else if (row_ptr->previous &&
|
||||||
row_ptr->previous->par->footnoteflag
|
row_ptr->previous->par->footnoteflag
|
||||||
== LyXParagraph::OPEN_FOOTNOTE) {
|
== LyXParagraph::OPEN_FOOTNOTE) {
|
||||||
@ -3857,10 +3902,65 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
|
|||||||
offset, LColor::footnote);
|
offset, LColor::footnote);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draw appendix lines
|
||||||
|
LyXParagraph * firstpar = row_ptr->par->FirstPhysicalPar();
|
||||||
|
if (firstpar->appendix){
|
||||||
|
pain.line(1, offset,
|
||||||
|
1, offset + row_ptr->height,
|
||||||
|
LColor::appendixline);
|
||||||
|
pain.line(paperwidth - 2, offset,
|
||||||
|
paperwidth - 2, offset + row_ptr->height,
|
||||||
|
LColor::appendixline);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draw minipage line
|
||||||
|
bool minipage = firstpar->pextra_type == LyXParagraph::PEXTRA_MINIPAGE;
|
||||||
|
if (minipage)
|
||||||
|
pain.line(LYX_PAPER_MARGIN/5 + box_x, offset,
|
||||||
|
LYX_PAPER_MARGIN/5 + box_x,
|
||||||
|
offset + row_ptr->height - 1,
|
||||||
|
LColor::minipageline);
|
||||||
|
|
||||||
|
// Draw depth lines
|
||||||
|
int depth = firstpar->GetDepth();
|
||||||
|
if (depth > 0) {
|
||||||
|
int next_depth = 0;
|
||||||
|
int prev_depth = 0;
|
||||||
|
if (row_ptr->next)
|
||||||
|
if (row_ptr->par->footnoteflag ==
|
||||||
|
row_ptr->next->par->footnoteflag)
|
||||||
|
next_depth = row_ptr->next->par->GetDepth();
|
||||||
|
else if (row_ptr->par->footnoteflag != LyXParagraph::OPEN_FOOTNOTE)
|
||||||
|
next_depth = depth;
|
||||||
|
|
||||||
|
if (row_ptr->previous)
|
||||||
|
if (row_ptr->par->footnoteflag ==
|
||||||
|
row_ptr->previous->par->footnoteflag)
|
||||||
|
prev_depth = row_ptr->previous->par->GetDepth();
|
||||||
|
else if (row_ptr->par->footnoteflag != LyXParagraph::OPEN_FOOTNOTE)
|
||||||
|
prev_depth = depth;
|
||||||
|
|
||||||
|
for (int i = 1; i <= depth; ++i) {
|
||||||
|
int line_x = (LYX_PAPER_MARGIN/5)*(i+minipage)+box_x;
|
||||||
|
pain.line(line_x, offset, line_x,
|
||||||
|
offset + row_ptr->height - 1 - (i-next_depth-1)*3,
|
||||||
|
LColor::depthbar);
|
||||||
|
|
||||||
|
if (i > prev_depth)
|
||||||
|
pain.fillRectangle(line_x, offset, LYX_PAPER_MARGIN/5, 2,
|
||||||
|
LColor::depthbar);
|
||||||
|
if (i > next_depth)
|
||||||
|
pain.fillRectangle(line_x,
|
||||||
|
offset + row_ptr->height - 2 - (i-next_depth-1)*3,
|
||||||
|
LYX_PAPER_MARGIN/5, 2,
|
||||||
|
LColor::depthbar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LyXLayout const & layout =
|
LyXLayout const & layout =
|
||||||
textclasslist.Style(buffer->params.textclass,
|
textclasslist.Style(buffer->params.textclass,
|
||||||
row_ptr->par->GetLayout());
|
row_ptr->par->GetLayout());
|
||||||
firstpar = row_ptr->par->FirstPhysicalPar();
|
|
||||||
|
|
||||||
y_top = 0;
|
y_top = 0;
|
||||||
y_bottom = row_ptr->height;
|
y_bottom = row_ptr->height;
|
||||||
@ -4052,7 +4152,7 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* is it a last row? */
|
/* is it a last row? */
|
||||||
par = row_ptr->par->LastPhysicalPar();
|
LyXParagraph * par = row_ptr->par->LastPhysicalPar();
|
||||||
if (row_ptr->par->ParFromPos(last + 1) == par
|
if (row_ptr->par->ParFromPos(last + 1) == par
|
||||||
&& (!row_ptr->next || row_ptr->next->par != row_ptr->par)) {
|
&& (!row_ptr->next || row_ptr->next->par != row_ptr->par)) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user