Merge branch '2.0.x' of git.lyx.org:lyx into 2.0.x

This commit is contained in:
Uwe Stöhr 2012-05-07 22:21:04 +02:00
commit 213f8f7237
33 changed files with 297 additions and 269 deletions

13
NEWS
View File

@ -2,12 +2,13 @@ What's new in version 2.0.4?
----------------------------
...
We migrated our development from subversion to git revision control sytem.
If you follow or maintain packaging of up-to-date versions ox LyX 2.0.x
you must switch to the new repository address
git://git.lyx.org/lyx, branch 2.0.x.
See lyx.org for details (TODO: we still have http://www.lyx.org/HowToUseSVN
on official pages).
We have migrated our development from subversion to the git revision
control sytem. If you follow or maintain packaging of up-to-date versions
of LyX 2.0.x, you must switch to the new repository address:
git://git.lyx.org/lyx
Branch 2.0.x is the stable branch. See
http://wiki.lyx.org/Devel/LyXGit
for details.
What's new in version 2.0.3?

View File

@ -1476,6 +1476,7 @@ dist_layouts_DATA =\
layouts/theorems-ams-bytype.module \
layouts/theorems-ams-extended.module \
layouts/theorems-ams-extended-bytype.module \
layouts/theorems-case.inc \
layouts/theorems-chap.module \
layouts/theorems.inc \
layouts/theorems-bytype.inc \

View File

@ -124,7 +124,7 @@ def checkTeXPaths():
inpname = tmpfname.replace('\\', '/')
else:
inpname = cmdOutput('cygpath -m ' + tmpfname)
logname = os.path.basename(inpname.replace('.ltx', '.log'))
logname = os.path.basename(re.sub("(?i).ltx", ".log", inpname))
inpname = inpname.replace('~', '\\string~')
os.write(fd, r'\relax')
os.close(fd)

View File

@ -5,7 +5,7 @@
# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
# Hacked June '09 by Paul Rubin <rubin@msu.edu> to use separate counters
# The environnements defined are :
# The environments defined are :
# - Theorem
# - Corollary
# - Lemma
@ -18,7 +18,7 @@
# - Exercise
# - Remark
# - Claim
# - Case (regular only -- defined as an enumeration)
# - Case (by inclusion)
# We need separate counters for each theorem-like style.
Format 35
@ -304,46 +304,4 @@ Style Claim
LabelCounter claim
End
# Define Case as an enumeration environment
Style Case
Category Theorem
Margin Static
LatexType Item_Environment
LatexName caseenv
LabelType Itemize
NextNoIndent 1
LeftMargin "Case ###."
ParSkip 0.0
ItemSep 0.2
TopSep 0.7
BottomSep 0.7
ParSep 0.3
Align Block
AlignPossible Block, Left
LabelSep xx
LabelString "Case #."
LabelFont
Series Medium
Shape Italic
EndFont
Preamble
\newcounter{casectr}
\newenvironment{caseenv}
{\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\parskip}
\setlength{\itemindent}{\listparindent}
\setlength{\itemsep}{\medskipamount}
\setlength{\topsep}{\itemsep}}
\setcounter{casectr}{0}
\usecounter{casectr}}
{\end{list}}
EndPreamble
LangPreamble
\providecommand{\casename}{_(Case)}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
EndBabelPreamble
End
Input theorems-case.inc

View File

@ -4,7 +4,7 @@
# Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
# The environnements defined are :
# The environments defined are :
# - Theorem
# - Corollary
# - Lemma
@ -17,7 +17,7 @@
# - Remark
# - Claim
# - Proof
# - Case (regular only -- defined as an enumeration)
# - Case (by inclusion)
Format 35
@ -270,48 +270,5 @@ Style Claim
EndBabelPreamble
End
# Define Case as an enumeration environment
Style Case
Category Theorem
Margin Static
LatexType Item_Environment
LatexName caseenv
LabelType Static
NextNoIndent 1
LeftMargin "Case ###."
ParSkip 0.0
ItemSep 0.2
TopSep 0.7
BottomSep 0.7
ParSep 0.3
Align Block
AlignPossible Block, Left
LabelSep xx
LabelString "Case #."
LabelFont
Series Medium
Shape Italic
EndFont
Preamble
\newcounter{casectr}
\newenvironment{caseenv}
{\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\parskip}
\setlength{\itemindent}{\listparindent}
\setlength{\itemsep}{\medskipamount}
\setlength{\topsep}{\itemsep}}
\setcounter{casectr}{0}
\usecounter{casectr}}
{\end{list}}
EndPreamble
LangPreamble
\providecommand{\casename}{_(Case)}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
EndBabelPreamble
End
Input theorems-case.inc
Input theorems-refprefix.inc

View File

@ -5,7 +5,7 @@
# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
# Hacked June '09 by Paul Rubin <rubin@msu.edu> to use separate counters
# The environnements defined are :
# The environments defined are :
# - Theorem
# - Corollary
# - Lemma
@ -19,7 +19,7 @@
# - Remark
# - Claim
# - Proof
# - Case (regular only -- defined as an enumeration)
# - Case (by inclusion)
Format 35
@ -280,39 +280,5 @@ Style Claim
LabelCounter claim
End
# Define Case as an enumeration environment
Style Case
Category Theorem
CopyStyle Enumerate
LatexName caseenv
LabelType Static
LeftMargin "Case ###."
LabelString "Case #."
LabelFont
Series Medium
Shape Italic
EndFont
Preamble
\newcounter{casectr}
\newenvironment{caseenv}
{\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\parskip}
\setlength{\itemindent}{\listparindent}
\setlength{\itemsep}{\medskipamount}
\setlength{\topsep}{\itemsep}}
\setcounter{casectr}{0}
\usecounter{casectr}}
{\end{list}}
EndPreamble
LangPreamble
\providecommand{\casename}{_(Case)}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
EndBabelPreamble
RefPrefix OFF
End
Input theorems-case.inc
Input theorems-refprefix.inc

View File

@ -0,0 +1,57 @@
# Original Author : Paul Rubin <rubin@msu.edu>
# Modified by Richard Heck to use enumitem
# Definition of case environment as an enumeration
# Define Case as an enumeration environment
# with its own counters
Format 35
Counter casei
LabelString "Case \arabic{casei}."
End
Counter caseii
Within casei
LabelString "Case \roman{caseii}."
End
Counter caseiii
Within caseii
LabelString "Case \alph{caseiii}."
End
Counter caseiv
Within caseiii
LabelString "Case \arabic{caseiv}."
End
Style Case
Category Theorem
CopyStyle Enumerate
LatexName casenv
LabelType Enumerate
LeftMargin "Case ###."
LabelCounter case
LabelFont
Series Medium
Shape Italic
EndFont
Requires enumitem
# It'd be easier to use \setlist[caseenv] here, but that causes problems
# if you nest an ordinary list inside a case environment. See discussion
# at bug #7611.
Preamble
\newlist{casenv}{enumerate}{4}
\setlist[casenv]{leftmargin=*,align=left,widest={iiii}}
\setlist[casenv,1]{label={{\itshape\ \casename} \arabic*.},ref=\arabic*}
\setlist[casenv,2]{label={{\itshape\ \casename} \roman*.},ref=\roman*}
\setlist[casenv,3]{label={{\itshape\ \casename\ \alph*.}},ref=\alph*}
\setlist[casenv,4]{label={{\itshape\ \casename} \arabic*.},ref=\arabic*}
EndPreamble
LangPreamble
\providecommand{\casename}{_(Case)}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
EndBabelPreamble
RefPrefix OFF
End

View File

@ -4,7 +4,7 @@
# Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
# The environnements defined are :
# The environments defined are :
# - Theorem
# - Corollary
# - Lemma
@ -16,8 +16,7 @@
# - Exercise
# - Remark
# - Claim
# - Proof
# - Case (regular only -- defined as an enumeration)
# - Case (by inclusion)
Format 35
@ -270,39 +269,5 @@ Style Claim
EndBabelPreamble
End
# Define Case as an enumeration environment
Style Case
Category Theorem
CopyStyle Enumerate
LatexName caseenv
LabelType Static
LeftMargin "Case ###."
LabelString "Case #."
LabelFont
Series Medium
Shape Italic
EndFont
Preamble
\newcounter{casectr}
\newenvironment{caseenv}
{\begin{list}{{\itshape\ \protect\casename} \arabic{casectr}.}{%
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\parskip}
\setlength{\itemindent}{\listparindent}
\setlength{\itemsep}{\medskipamount}
\setlength{\topsep}{\itemsep}}
\setcounter{casectr}{0}
\usecounter{casectr}}
{\end{list}}
EndPreamble
LangPreamble
\providecommand{\casename}{_(Case)}
EndLangPreamble
BabelPreamble
\addto\captions$$lang{\renewcommand{\casename}{_(Case)}}
EndBabelPreamble
RefPrefix OFF
End
Input theorems-case.inc
Input theorems-refprefix.inc

View File

@ -6642,7 +6642,7 @@ msgstr "En serie"
#: lib/layouts/apa.layout:414 lib/layouts/apa.layout:415
#: lib/layouts/stdcounters.inc:48
msgid "(\\alph{enumii})"
msgstr "(\\alph{enumii})"
msgstr "\\alph{enumii})"
#: lib/layouts/armenian-article.layout:9
msgid "LatinOn"
@ -10120,11 +10120,11 @@ msgstr "\\arabic{enumi}."
#: lib/layouts/stdcounters.inc:53
msgid "\\roman{enumiii}."
msgstr "\\roman{enumiii}."
msgstr "\\arabic{enumiii})"
#: lib/layouts/stdcounters.inc:58
msgid "\\Alph{enumiv}."
msgstr "\\Alph{enumiv}."
msgstr "\\alph{enumiv}'"
#: lib/layouts/stdcounters.inc:68
msgid "Equation ##"

View File

@ -6924,7 +6924,7 @@ msgstr "En série"
#: lib/layouts/apa.layout:414 lib/layouts/apa.layout:415
#: lib/layouts/stdcounters.inc:48
msgid "(\\alph{enumii})"
msgstr "(\\alph{enumii})"
msgstr "\\alph{enumii})"
#: lib/layouts/armenian-article.layout:9
msgid "LatinOn"
@ -10573,11 +10573,11 @@ msgstr "\\arabic{enumi}."
#: lib/layouts/stdcounters.inc:53
msgid "\\roman{enumiii}."
msgstr "\\roman{enumiii}."
msgstr "\\arabic{enumiii})"
#: lib/layouts/stdcounters.inc:58
msgid "\\Alph{enumiv}."
msgstr "\\Alph{enumiv}."
msgstr "\\alph{enumiv}'"
#: lib/layouts/stdcounters.inc:68
#, fuzzy

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: LyX-2.1\n"
"Report-Msgid-Bugs-To: lyx-devel@lists.lyx.org\n"
"POT-Creation-Date: 2012-04-12 07:51-0400\n"
"POT-Creation-Date: 2012-05-05 10:14+0200\n"
"PO-Revision-Date: 2012-04-08 11:27+0100\n"
"Last-Translator: Kornel Benko <kornel@lyx.org>\n"
"Language-Team: Slovak <lyx-docs@lists.lyx.org>\n"
@ -2324,7 +2324,9 @@ msgstr ""
#: src/frontends/qt4/ui/LocalLayoutUi.ui:19
msgid "Document-specific layout information"
msgstr "Špecifikácia alternatívnych schém tohto dokumentu"
msgstr ""
"Špecifikácia dodatočných schém pre tento dokument.\n"
"Formát je ako v súboroch '*.layout'"
#: src/frontends/qt4/ui/LocalLayoutUi.ui:35
msgid "Errors reported in terminal."
@ -10286,6 +10288,22 @@ msgstr "Pripomienka \\thetheorem."
msgid "Claim \\thetheorem."
msgstr "Nárok \\thetheorem."
#: lib/layouts/theorems-case.inc:12
msgid "Case \\arabic{casei}."
msgstr "Prípad \\arabic{casei}."
#: lib/layouts/theorems-case.inc:16
msgid "Case \\roman{caseii}."
msgstr "Prípad \\roman{caseii}."
#: lib/layouts/theorems-case.inc:20
msgid "Case \\alph{caseiii}."
msgstr "Prípad \\alph{caseiii}."
#: lib/layouts/theorems-case.inc:24
msgid "Case \\arabic{caseiv}."
msgstr "Prípad \\arabic{caseiv}."
#: lib/layouts/theorems-order.inc:46 lib/layouts/theorems-starred.inc:173
msgid "Example*"
msgstr "Príklad*"

View File

@ -195,6 +195,9 @@ public:
/// is this an unnamed file (New...)?
bool unnamed;
/// is this an internal bufffer?
bool internal_buffer;
/// buffer is r/o
bool read_only;
@ -352,12 +355,12 @@ static FileName createBufferTmpDir()
Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
Buffer const * cloned_buffer)
: owner_(owner), lyx_clean(true), bak_clean(true), unnamed(false),
read_only(readonly_), filename(file), file_fully_loaded(false),
toc_backend(owner), macro_lock(false), timestamp_(0),
checksum_(0), wa_(0), gui_(0), undo_(*owner), bibinfo_cache_valid_(false),
bibfile_cache_valid_(false), cite_labels_valid_(false),
cloned_buffer_(cloned_buffer), clone_list_(0), doing_export(false),
parent_buffer(0)
internal_buffer(false), read_only(readonly_), filename(file),
file_fully_loaded(false), toc_backend(owner), macro_lock(false),
timestamp_(0), checksum_(0), wa_(0), gui_(0), undo_(*owner),
bibinfo_cache_valid_(false), bibfile_cache_valid_(false),
cite_labels_valid_(false), cloned_buffer_(cloned_buffer),
clone_list_(0), doing_export(false), parent_buffer(0)
{
if (!cloned_buffer_) {
temppath = createBufferTmpDir();
@ -376,6 +379,7 @@ Buffer::Impl::Impl(Buffer * owner, FileName const & file, bool readonly_,
bibfile_status_ = cloned_buffer_->d->bibfile_status_;
unnamed = cloned_buffer_->d->unnamed;
cite_labels_valid_ = cloned_buffer_->d->cite_labels_valid_;
internal_buffer = cloned_buffer_->d->internal_buffer;
}
@ -2580,7 +2584,13 @@ bool Buffer::isUnnamed() const
/// retrieving fileName() nor for checking if it is unnamed or not.
bool Buffer::isInternal() const
{
return fileName().extension() == "internal";
return d->internal_buffer;
}
void Buffer::setInternal(bool flag)
{
d->internal_buffer = flag;
}

View File

@ -364,6 +364,8 @@ public:
/// automatically saved, nor it needs to trigger any "do you want to save ?" question.
bool isInternal() const;
void setInternal(bool flag);
/// Mark this buffer as dirty.
void markDirty();

View File

@ -470,7 +470,8 @@ void putClipboard(ParagraphList const & paragraphs,
// some kind of garbage collection there, or a shared_ptr, then this
// would not be needed.
static Buffer * buffer = theBufferList().newBuffer(
FileName::tempName().absFileName() + "_clipboard.internal");
FileName::tempName("clipboard.internal").absFileName());
buffer->setInternal(true);
buffer->setUnnamed(true);
buffer->paragraphs() = paragraphs;
buffer->inset().setBuffer(*buffer);

View File

@ -212,7 +212,7 @@ string layoutpost =
LayoutFileIndex LayoutFileList::addEmptyClass(string const & textclass)
{
FileName const tempLayout = FileName::tempName();
FileName const tempLayout = FileName::tempName("basic_layout");
ofstream ofs(tempLayout.toFilesystemEncoding().c_str());
// This writes a very basic class, but it also attempts to include
// stdclass.inc. That would give us something moderately usable.

View File

@ -127,6 +127,9 @@ public:
*/
virtual int text(int x, int y, char_type c, FontInfo const & f) = 0;
/// draw the underbar, strikeout, uuline and uwave font attributes
virtual void textDecoration(FontInfo const & f, int x, int y, int width) = 0;
/**
* Draw a string and enclose it inside a rectangle. If
* back color is specified, the background is cleared with

View File

@ -335,14 +335,7 @@ int GuiPainter::text(int x, int y, docstring const & s,
if (f.realShape() == SMALLCAPS_SHAPE) {
textwidth = smallCapsText(x, y, str, f);
if (f.underbar() == FONT_ON)
underline(f, x, y, textwidth);
if (f.strikeout() == FONT_ON)
strikeoutLine(f, x, y, textwidth);
if (f.uuline() == FONT_ON)
doubleUnderline(f, x, y, textwidth);
if (f.uwave() == FONT_ON)
wavyHorizontalLine(x, y, textwidth, f.realColor().baseColor);
textDecoration(f, x, y, textwidth);
return textwidth;
}
@ -350,15 +343,7 @@ int GuiPainter::text(int x, int y, docstring const & s,
// textwidth = fontMetrics().width(str);
// because the above is awfully expensive on MacOSX
textwidth = fm.width(s);
if (f.underbar() == FONT_ON)
underline(f, x, y, textwidth);
if (f.strikeout() == FONT_ON)
strikeoutLine(f, x, y, textwidth);
if (f.uuline() == FONT_ON)
doubleUnderline(f, x, y, textwidth);
if (f.uwave() == FONT_ON)
// f.color() doesn't work on some circumstances
wavyHorizontalLine(x, y, textwidth, f.realColor().baseColor);
textDecoration(f, x, y, textwidth);
if (!isDrawingEnabled())
return textwidth;
@ -441,6 +426,20 @@ int GuiPainter::text(int x, int y, docstring const & s,
}
void GuiPainter::textDecoration(FontInfo const & f, int x, int y, int width)
{
if (f.underbar() == FONT_ON)
underline(f, x, y, width);
if (f.strikeout() == FONT_ON)
strikeoutLine(f, x, y, width);
if (f.uuline() == FONT_ON)
doubleUnderline(f, x, y, width);
if (f.uwave() == FONT_ON)
// f.color() doesn't work on some circumstances
wavyHorizontalLine(x, y, width, f.realColor().baseColor);
}
static int max(int a, int b) { return a > b ? a : b; }

View File

@ -93,6 +93,9 @@ public:
/// draw a char at position x, y (y is the baseline)
virtual int text(int x, int y, char_type c, FontInfo const & f);
///
virtual void textDecoration(FontInfo const & f, int x, int y, int width);
/// draw a string and enclose it inside a button frame
virtual void buttonText(int x, int baseline, docstring const & s,
FontInfo const & font, bool mouseHover);

View File

@ -1370,7 +1370,8 @@ bool GuiWorkArea::isFullScreen()
EmbeddedWorkArea::EmbeddedWorkArea(QWidget * w): GuiWorkArea(w)
{
buffer_ = theBufferList().newBuffer(
support::FileName::tempName().absFileName() + "_embedded.internal");
support::FileName::tempName("embedded.internal").absFileName());
buffer_->setInternal(true);
buffer_->setUnnamed(true);
buffer_->setFullyLoaded(true);
setBuffer(*buffer_);

View File

@ -211,14 +211,20 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd,
{
switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
case LFUN_INSET_MODIFY: {
string const first_arg = cmd.getArg(0);
if (first_arg == "changetype") {
string const type = cmd.getArg(1);
flag.setOnOff(type == params_.type);
flag.setEnabled(!params_.inner_box || type != "Framed");
return true;
}
if (first_arg == "box") {
flag.setEnabled(true);
return true;
}
return InsetCollapsable::getStatus(cur, cmd, flag);
}
case LFUN_INSET_DIALOG_UPDATE:
flag.setEnabled(true);

View File

@ -48,7 +48,9 @@ void InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const
{
Dimension dim0;
cell(0).metrics(mi, dim0);
Dimension t = theFontMetrics(mi.base.font).dimension('{');
FontInfo font = mi.base.font;
augmentFont(font, from_ascii("mathnormal"));
Dimension t = theFontMetrics(font).dimension('{');
dim.asc = max(dim0.asc, t.asc);
dim.des = max(dim0.des, t.des);
dim.wid = dim0.width() + 2 * t.wid;
@ -59,6 +61,7 @@ void InsetMathBrace::metrics(MetricsInfo & mi, Dimension & dim) const
void InsetMathBrace::draw(PainterInfo & pi, int x, int y) const
{
FontInfo font = pi.base.font;
augmentFont(font, from_ascii("mathnormal"));
font.setShape(UP_SHAPE);
font.setColor(Color_latex);
Dimension t = theFontMetrics(font).dimension('{');

View File

@ -280,7 +280,9 @@ void MathData::metrics(MetricsInfo & mi, Dimension & dim) const
if (completion.length() == 0)
continue;
dim.wid += mathed_string_width(mi.base.font, completion);
FontInfo font = mi.base.font;
augmentFont(font, from_ascii("mathnormal"));
dim.wid += mathed_string_width(font, completion);
}
// Cache the dimension.
mi.base.bv->coordCache().arrays().add(this, dim);
@ -328,6 +330,7 @@ void MathData::draw(PainterInfo & pi, int x, int y) const
if (completion.length() == 0)
continue;
FontInfo f = pi.base.font;
augmentFont(f, from_ascii("mathnormal"));
// draw the unique and the non-unique completion part
// Note: this is not time-critical as it is

View File

@ -535,7 +535,6 @@ char_type Parser::getChar()
{
if (!good()) {
error("The input stream is not well...");
putback();
return 0;
}
return tokens_[pos_++].character();
@ -544,9 +543,12 @@ char_type Parser::getChar()
docstring Parser::getArg(char_type left, char_type right)
{
docstring result;
skipSpaces();
docstring result;
if (!good())
return result;
char_type c = getChar();
if (c != left)

View File

@ -488,9 +488,18 @@ void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
}
void metricsStrRedBlack(MetricsInfo & mi, Dimension & dim, docstring const & str)
{
FontInfo font = mi.base.font;
augmentFont(font, from_ascii("mathnormal"));
mathed_string_dim(font, str, dim);
}
void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str)
{
FontInfo f = pi.base.font;
augmentFont(f, from_ascii("mathnormal"));
f.setColor(Color_latex);
pi.pain.text(x, y, str, f);
}
@ -499,6 +508,7 @@ void drawStrRed(PainterInfo & pi, int x, int y, docstring const & str)
void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & str)
{
FontInfo f = pi.base.font;
augmentFont(f, from_ascii("mathnormal"));
f.setColor(Color_foreground);
pi.pain.text(x, y, str, f);
}

View File

@ -295,7 +295,11 @@ ParagraphList::const_iterator makeCommand(Buffer const & buf,
send = searchParagraph(par, pend);
par = makeParagraph(buf, os, runparams, text, par,send);
break;
default:
case LATEX_BIB_ENVIRONMENT:
case LATEX_LIST_ENVIRONMENT:
// FIXME This means that we are just skipping any paragraph that
// isn't implemented above.
++par;
break;
}
}
@ -349,7 +353,11 @@ void docbookParagraphs(Text const & text,
send = searchParagraph(par, pend);
par = makeParagraph(buf, os, runparams, text, par,send);
break;
default:
case LATEX_BIB_ENVIRONMENT:
case LATEX_LIST_ENVIRONMENT:
// FIXME This means that we are just skipping any paragraph that
// isn't implemented above.
++par;
break;
}
// makeEnvironment may process more than one paragraphs and bypass pend

View File

@ -360,6 +360,14 @@ void RowPainter::paintChars(pos_type & vpos, FontInfo const & font,
}
void RowPainter::paintSeparator(double orig_x, double width,
FontInfo const & font)
{
pi_.pain.textDecoration(font, int(orig_x), yo_, int(width));
x_ += width;
}
void RowPainter::paintForeignMark(double orig_x, Language const * lang,
int desc)
{
@ -922,9 +930,10 @@ void RowPainter::paintText()
if (par_.isSeparator(pos)) {
Font const orig_font = text_metrics_.displayFont(pit_, pos);
double const orig_x = x_;
x_ += width_pos;
double separator_width = width_pos;
if (pos >= body_pos)
x_ += row_.separator;
separator_width += row_.separator;
paintSeparator(orig_x, separator_width, orig_font.fontInfo());
paintForeignMark(orig_x, orig_font.language());
++vpos;

View File

@ -58,6 +58,7 @@ public:
void paintSelection();
private:
void paintSeparator(double orig_x, double width, FontInfo const & font);
void paintForeignMark(double orig_x, Language const * lang, int desc = 0);
void paintMisspelledMark(double orig_x, bool changed);
void paintHebrewComposeChar(pos_type & vpos, FontInfo const & font);

View File

@ -183,7 +183,7 @@ public:
/// \p mask must be in filesystem encoding, if it contains a
/// relative path, the template file will be created in the global
/// temporary directory as given by 'package().temp_dir()'.
static FileName tempName(std::string const & mask = empty_string());
static FileName tempName(std::string const & mask);
static FileName tempName(FileName const & temp_dir,
std::string const & mask);

View File

@ -388,7 +388,7 @@ string remove_braces(string const & value)
} // anonymous namespace
Preamble::Preamble() : one_language(true)
Preamble::Preamble() : one_language(true), title_layout_found(false)
{
//h_backgroundcolor;
//h_boxbgcolor;

View File

@ -55,6 +55,10 @@ public:
void addModule(std::string const & module);
///
void suppressDate(bool suppress);
///
bool titleLayoutFound() const { return title_layout_found; }
///
void titleLayoutFound(bool found) { title_layout_found = found; }
/// Register an author named \p name in the author list
void registerAuthor(std::string const & name);
/// Get author named \p name (must be registered first)
@ -78,6 +82,9 @@ private:
/// needed to handle encodings with babel
bool one_language;
/// was at least one title layout found?
bool title_layout_found;
std::ostringstream h_preamble;
std::string h_backgroundcolor;
std::string h_boxbgcolor;

View File

@ -42,6 +42,13 @@
\begin{document}
\title{Title}
\date %stupid stuff
{two days ago}
\maketitle
\tableofcontents
\noindent This paragraph is not indented.

View File

@ -1165,8 +1165,7 @@ void parse_unknown_environment(Parser & p, string const & name, ostream & os,
void parse_environment(Parser & p, ostream & os, bool outer,
string & last_env, bool & title_layout_found,
Context & parent_context)
string & last_env, Context & parent_context)
{
Layout const * newlayout;
InsetLayout const * newinsetlayout = 0;
@ -1511,8 +1510,8 @@ void parse_environment(Parser & p, ostream & os, bool outer,
context.check_end_deeper(os);
parent_context.new_paragraph(os);
p.skip_spaces();
if (!title_layout_found)
title_layout_found = newlayout->intitle;
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
for (set<string>::const_iterator it = req.begin(); it != req.end(); it++)
preamble.registerAutomaticallyLoadedPackage(*it);
@ -1906,7 +1905,6 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
bool const use_natbib = preamble.isPackageUsed("natbib");
bool const use_jurabib = preamble.isPackageUsed("jurabib");
string last_env;
bool title_layout_found = false;
while (p.good()) {
Token const & t = p.get_token();
@ -2233,7 +2231,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
else if (t.cs() == "begin")
parse_environment(p, os, outer, last_env,
title_layout_found, context);
context);
else if (t.cs() == "end") {
if (flags & FLAG_END) {
@ -2411,10 +2409,14 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
// Must catch empty dates before findLayout is called below
else if (t.cs() == "date") {
eat_whitespace(p, os, context, false);
p.pushPosition();
string const date = p.verbatim_item();
if (date.empty())
p.popPosition();
if (date.empty()) {
preamble.suppressDate(true);
else {
p.verbatim_item();
} else {
preamble.suppressDate(false);
if (context.new_layout_allowed &&
(newlayout = findLayout(context.textclass,
@ -2422,16 +2424,17 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
// write the layout
output_command_layout(os, p, outer,
context, newlayout);
p.skip_spaces();
if (!title_layout_found)
title_layout_found = newlayout->intitle;
parse_text_snippet(p, os, FLAG_ITEM, outer, context);
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
for (set<string>::const_iterator it = req.begin();
it != req.end(); it++)
preamble.registerAutomaticallyLoadedPackage(*it);
} else
handle_ert(os, "\\date{" + date + '}',
context);
handle_ert(os,
"\\date{" + p.verbatim_item() + '}',
context);
}
}
@ -2444,8 +2447,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
p.get_token();
output_command_layout(os, p, outer, context, newlayout);
p.skip_spaces();
if (!title_layout_found)
title_layout_found = newlayout->intitle;
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
for (set<string>::const_iterator it = req.begin(); it != req.end(); it++)
preamble.registerAutomaticallyLoadedPackage(*it);
@ -2457,8 +2460,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
// write the layout
output_command_layout(os, p, outer, context, newlayout);
p.skip_spaces();
if (!title_layout_found)
title_layout_found = newlayout->intitle;
if (!preamble.titleLayoutFound())
preamble.titleLayoutFound(newlayout->intitle);
set<string> const & req = newlayout->requires();
for (set<string>::const_iterator it = req.begin(); it != req.end(); it++)
preamble.registerAutomaticallyLoadedPackage(*it);
@ -2744,7 +2747,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
}
else if (t.cs() == "makeindex" || t.cs() == "maketitle") {
if (title_layout_found) {
if (preamble.titleLayoutFound()) {
// swallow this
skip_spaces_braces(p);
} else

View File

@ -32,6 +32,9 @@ What's new
- Made some minor improvements to the include_bib.py script.
- Case environments provided by theorem modules should now nest
properly (bug 7611).
* TEX2LYX IMPROVEMENTS
@ -75,14 +78,8 @@ What's new
* DOCUMENT INPUT/OUTPUT
- Fixed assertions on Windows for XHTML output (bug 8078).
- Fix reconfiguration on Windows when the user directory is a UNC path
(bug 8098).
- Index entries in XHTML output no longer sorted case sensitively.
- Fixed some problems XHTML output had with empty paragraphs.
- Fixed an infinite loop when exporting a file with list
or bibliography environments to DocBook (bug 7914).
- Fixed reading the bounding box from EPS figures with negative
values (bug 8114).
@ -91,15 +88,11 @@ What's new
flag by using the same latex backend used for previewing the document
instead of always using the plain latex backend.
- Fixed XHTML export of sub- and superscripts.
- When configuring LyX, check for all LaTeX-packages LyX uses to display
symbols (bug 8102).
- Don't output extra body tags with included files when generating
XHTML.
- Do not include deleted text in the title of the XHTML output.
- Fix the naming of some temporary files such that they are created
in LyX's temporary directory.
* USER INTERFACE
@ -107,8 +100,20 @@ What's new
- Fixed crash when modifying or pasting an equation label and there
are references to that label in math (bug 8095).
- Fix crash when clicking away in the same math inset just after hitting '\'
(bug 8140).
- Fix crash when dissolving a math macro whose first argument is another
parameterless macro (bug 8105).
- Update the current view after dispatching a command through the lyxserver.
The missing screen update could cause either a failure in executing the
command or could even crash LyX (bugs 6871 and 8119).
- Fixed assertion on selection of insets in RTL text (bug 7518).
- Fixed an infinite loop when pasting '\\ ' into math (bug 8089).
- Don't reset the selected format each time we click into a new paragraph
in View->Source (bug 7997).
@ -123,6 +128,9 @@ What's new
- Allow the <Enter> key to add a new branch in document settings.
Only <Ctrl+Enter> and numpad-<Enter> will also close the dialog.
- Box settings dialog didn't work if you were actually inside the box
(bug 8124).
- Fix tooltip for "Use Non-TeX Fonts" (bug 7787).
- Fix pasting of LATIN CAPITAL LETTER SHARP S (bug 8057).
@ -130,10 +138,6 @@ What's new
- Setting a multirow offset no longer also changes table column
alignments (bug 8084).
- Fixed stray warning when inserting inserting plaintext file (bug 7916).
- Fix undo warning when inserting plain text file (bug 7916).
- Do not repeatedly show export errors of a previous export.
- Fix the selection of rows below a multirow (bug 8083).
@ -147,27 +151,26 @@ What's new
- Made it possible to delete local layout in Document>Settings.
- Fix crash when dissolving a math macro whose first argument is another
parameterless macro (bug 8105).
- Update the current view after dispatching a command through the lyxserver.
The missing screen update could cause either a failure in executing the
command or could even crash LyX (bugs 6871 and 8119).
- Improve thesaurus dialog completion (bug 8138)
- Fix erroneous error message when calling "buffer-language" manually.
- Fix coloring of insets that come after deleted text insets with
change tracking on.
- Fix the random coloring of text when change tracking is on and
pixmap caching is enabled (bug 7667).
- Fix coloring of insets that come after deleted text insets with
change tracking on.
- Fix the coloring of Quotation marks with change tracking (bug 7653).
- Fix crash when clicking away in the same math inset just after hitting '\'
(bug 8140).
- Fixed stray warning when inserting inserting plaintext file (bug 7916).
- Fix undo warning when inserting plain text file (bug 7916).
- Fix display of special characters like '\#', '{..}' and of auto-
completion in math insets with a special font, e.g. mathcal (bug 5167).
- Fix the painting of underbar and strikeout which span spaces (bug 953).
* DOCUMENTATION AND LOCALIZATION
@ -176,10 +179,31 @@ What's new
- Re-enable the compilation of the modernCV.lyx example file (bug 8064).
- Fix on screen display of nested enumerations in Spanish and Galician.
* LYXHTML
- Fixed assertions on Windows for XHTML output (bug 8078).
- Fix reconfiguration on Windows when the user directory is a UNC path
(bug 8098).
- Index entries in XHTML output no longer sorted case sensitively.
- Fixed some problems XHTML output had with empty paragraphs.
- Fixed XHTML export of sub- and superscripts.
- Don't output extra body tags with included files when generating
XHTML.
- Do not include deleted text in the title of the XHTML output.
* TEX2LYX
-
- Fix import of \date (regression, bug 8104).
* ADVANCED FIND AND REPLACE
@ -196,3 +220,6 @@ What's new
- Included the qt gif plugin in the Windows installer. This
enables the busy icon in the status bar.
- Remove a temporary log file from the user directory after reconfigure.