read the Changelog, preparing for prerelease

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@680 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-04-19 01:42:55 +00:00
parent 11c1e71c05
commit d0950aceda
60 changed files with 386 additions and 237 deletions

View File

@ -1,4 +1,4 @@
Public release of LyX version 1.1.2
Public release of LyX version 1.1.5cvs
===================================
What is LyX?
@ -37,7 +37,7 @@ A very incomplete feature list:
- export LaTeX, ASCII, DVI, PostScript, LinuxDoc-SGML, DocBook-SGML
- fair support for non-English documents and/or menus
- extensive documentation, including a tutorial
- version control using RCS
- version control using RCS (some support for CVS)
How stable is LyX?
------------------
@ -66,28 +66,20 @@ with mirrors at
The source code package is available at:
ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.0.4.tar.gz
ftp://ftp.devel.lyx.org/pub/lyx/lyx-1.0.4.tar.gz
ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.1.5.tar.gz
ftp://ftp.devel.lyx.org/pub/lyx/lyx-1.1.5.tar.gz
and at the mirrors listed above.
You need to have XForms version 0.81, 0.86 or 0.88 to compile your own
You need to have XForms version 0.88 or newer to compile your own
version. Version 0.88 is highly recomended. LyX should also compile
with 0.89.
Ready-to-run precompiled binaries for various platforms are available at:
ftp://ftp.lyx.org/pub/lyx/bin/1.0.4/
Binaries for i386-Linux are also available at your local sunsite mirror:
ftp://sunsite.unc.edu/pub/Linux/apps/editors/lyx-1.0.4-bin.tar.gz
Credits
-------
The LyX Team is composed of volunteers from around the world. Many, many
people have helped make the 1.0 release possible, including:
people have helped make the 1.1.x releasees possible, including:
Lars Gullik Bjoennes, Alejandro Aguilar Sierra, Asger Alstrup,
Jean-Marc Lasgouttes, Juergen Vigna, John P. Weiss, Bernhard Iselborn,

View File

@ -1,3 +1,27 @@
2000-04-19 Lars Gullik Bjønnes <larsbj@lyx.org>
* ANNOUNCE:
* INSTALL:
* UPGRADING:
* NEWS: updated for prerelease of 1.1.5. Please comment and send
patches for things that should be in or should be changed.
* src/* [insetfiles]: change "usigned char fragile" to bool
fragile. There was only one point that could that be questioned
and that is commented in formulamacro.C. Grep for "CHECK".
* src/CutAndPaste.C (getBufferTextClass): unused func, removed.
(DeleteBuffer): take it out of CutAndPaste and make it static.
2000-04-17 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/paragraph.C (TeXOnePar): use the new method in Spacing to
output the spacing envir commands. Also the new commands used in
the LaTeX output makes the result better.
* src/Spacing.C (writeEnvirBegin): new method
(writeEnvirEnd): new method
2000-04-18 Juergen Vigna <jug@sad.it>
* src/CutAndPaste.C: made textclass a static member of the class
@ -29,6 +53,23 @@
\end{array} if fragile
(MathParInset::Write): Put \protect before \\ if fragile
2000-04-15 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/lyx_gui.C (LyXGUI): initialize the LyXColorHandler. The
initialization if the LyXColorHandler must be done after the
connections to the XServer has been established.
* src/insets/figinset.C (runqueue): change the grabing a bit. Also
get the background pixel from the lyxColorhandler so that the
figures are rendered with the correct background color.
(NextToken): removed functions.
(GetPSSizes): use ifs >> string instead of NextToken.
* src/Painter.[Ch]: the color cache moved out of this file.
* src/ColorHandler.[Ch]: new files. Holds the gc cache for color
and lines.
2000-04-14 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/WorkArea.C (work_area_handler): call BufferView::enterView

10
INSTALL
View File

@ -34,8 +34,8 @@ You will need to have both an Xforms library and Xpm library to compile
LyX. It is imperative that you have the correct versions of these
libraries, and their associated header files.
As of LyX version 1.1.1, you will need to have Xforms library and header
version 0.81, 0.86, or 0.88. Version 0.88 is a stable release and the
As of LyX version 1.1.5, you will need to have Xforms library and header
version 0.88 or 0.89. Version 0.88 is a stable release and the
recommended version. On some systems, such as linux ELF, there are shared
library versions of the Xforms library, which require an installation step
to configure the system.
@ -58,11 +58,11 @@ libXpm can be found at:
(or similar locations at other sunsites like sunsite.unc.edu)
You will also need a recent C++ compiler, where recent means that the
compilers knows a bit about the C++ standard. Compilers that are known
compilers are close to C++ standard conforming. Compilers that are known
to compile LyX are gcc 2.8.1 and 2.95.x, the various versions of egcs
and Digital C++ version 6.1. Please tell us your experience with other
compilers. It is probably _not_ possible to compile LyX with gcc
2.7.x, but this may change in the future.
compilers. It is _not_ possible to compile LyX with gcc
2.7.x, and this is not likely to change in the future.
Note that, contrary to LyX 1.0.x, LyX 1.1.x makes great use of C++
Standard Template Library (STL); this means that gcc users will have

39
NEWS
View File

@ -1,3 +1,42 @@
What's new in LyX version 1.1.5?
--------------------------------
Lots of internal code rewritten, fixed, changed and added.
We are taking the C++ Standard Library in greater use for each day,
this will in most cases make the code clearer and easier to maintain
and expand.
We are also gearing up for the merge of the gui-indep branch, expect
this (but not the new gui's) in 1.1.6.
User-visible changes:
- Right-to-Left support for Hebrew and Arabic, this is a first attempt
only and is likely to improve in future versions.
- Removed support for XForms older than 0.88.
- Some commandline options and X resources are not supported anymore
(The color ones, and -mono -fastselection, -reverse)
- More accurate error reporting from LaTeX runs.
- Better definition for LyXList style.
- option \show_banner [true|false] added to .lyxrc commands.
- A couple of changes to the LyX format, so that files written with
1.1.5 will not be parsed correctly by older LyX versions if protected
spaces or the new per-paragraph spacing are used. Also the RtL
support is of course not supported in older versions.
- Per-paragraph spacing, currently only settable wrom the
command-line/window:
paragraph-spacing (default,single,onehalf,double,other) [float]
- .lyxrc feature: \backupdir_path that tells where the backup files
created by lyx will be stored.
What's new in LyX version 1.1.4?
--------------------------------

View File

@ -1,4 +1,4 @@
How do I upgrade my existing LyX system to version 1.1.2?
How do I upgrade my existing LyX system to version 1.1.5?
---------------------------------------------------------
If you upgrade from version 0.12.0 or 1.0.x, you shouldn't have
@ -14,9 +14,9 @@ Document transfer
-----------------
In general, you don't need to convert any documents saved with LyX
v0.10, v0.12.0 or v1.0.x to use them with LyX v1.1.2.
v0.10, v0.12.0 or v1.0.x to use them with LyX v1.1.5.
LyX v1.1.2 can read all documents saved with lyx-0.12.0 and later correctly.
LyX v1.1.5 can read all documents saved with lyx-0.12.0 and later correctly.
Documents saved with lyx-0.10.x are read correctly up to the old math
mode, which is not supported anymore. If you have documents with such
math formulas, you convert it using the program COLD, written by Preben
@ -27,5 +27,5 @@ Rhandol. COLD can be found at:
or at one of LyX archive mirror sites listed in README.
Documents saved with LyX version 1.1.2 can be read correctly by
LyX v0.12.0 and v1.0.x, except for new features.
Documents saved with LyX version 1.1.5 can be read correctly by
LyX v0.12.0 and v1.0.x, except for new and a couple of changed features.

View File

@ -20,12 +20,26 @@
using std::pair;
// Jürgen, note that this means that you cannot currently have a list
// of selections cut/copied. So IMHO later we should have a
// list/vector/deque that we could store
// struct selection_item {
// LyXParagraph * buf;
// LyXTextClassList::size_type textclass;
// };
// in and some method of choosing beween them (based on the first few chars
// in the selection probably.) This would be a nice feature and quite
// easy to implement. (Lgb)
static LyXParagraph * buf = 0;
static LyXTextClassList::size_type textclass;
// for now here this should be in another Cut&Paste Class!
//
void CutAndPaste::DeleteBuffer()
// Jürgen, I moved this out of CutAndPaste since it does not operate on any
// member of the CutAndPaste class and in addition it was private.
// Perhaps it even should take a parameter? (Lgb)
static
void DeleteBuffer()
{
if (!buf) return;
@ -381,12 +395,6 @@ int CutAndPaste::SwitchLayoutsBetweenClasses(LyXTextClassList::size_type c1,
}
LyXTextClassList::size_type CutAndPaste::getBufferTextClass() const
{
return textclass;
}
bool CutAndPaste::checkPastePossible(LyXParagraph * par, int) const
{
if (!buf) return false;

View File

@ -41,12 +41,7 @@ public:
LyXTextClassList::size_type class2,
LyXParagraph * par);
///
LyXTextClassList::size_type getBufferTextClass() const;
///
bool checkPastePossible(LyXParagraph *, int pos) const;
private:
///
void DeleteBuffer();
};
#endif

View File

@ -4,6 +4,7 @@
#ifdef HAVE_SSTREAM
#include <sstream>
using std::istringstream;
using std::ostringstream;
#else
#include <strstream>
#endif
@ -74,3 +75,58 @@ void Spacing::writeFile(ostream & os, bool para) const
os << cmd << spacing_string[getSpace()] << " \n";
}
}
string Spacing::writeEnvirBegin() const
{
switch(space) {
case Default: break; // do nothing
case Single:
return "\\begin{singlespace}";
break;
case Onehalf:
return "\\begin{onehalfspace}";
break;
case Double:
return "\\begin{doublespace}";
break;
case Other:
#ifdef HAVE_SSTREAM
ostringstream ost;
ost << "\\begin{spacing}{"
<< getValue() << "}";
return ost.str().c_str();
#else
{
char tmp[512];
ostrstream ost(tmp, 512);
ost << "\\begin{spacing}{"
<< getValue() << "}";
return ost.str();
}
#endif
break;
}
return string();
}
string Spacing::writeEnvirEnd() const
{
switch(space) {
case Default: break; // do nothing
case Single:
return "\\end{singlespace}";
break;
case Onehalf:
return "\\end{onehalfspace}";
break;
case Double:
return "\\end{doublespace}";
break;
case Other:
return "\\end{spacing}";
break;
}
return string();
}

View File

@ -14,6 +14,8 @@
#include <iosfwd>
#include "LString.h"
///
class Spacing {
public:
@ -47,6 +49,10 @@ public:
///
void writeFile(std::ostream &, bool para = false) const;
///
string writeEnvirBegin() const;
///
string writeEnvirEnd() const;
///
friend bool operator==(Spacing const & a, Spacing const & b) {
if (a.space == b.space && a.getValue() == b.getValue())
return true;

View File

@ -1428,11 +1428,11 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
#if 1
#ifdef HAVE_SSTREAM
std::ostringstream ost;
inset->Latex(ost, -1, free_spc);
inset->Latex(ost, true, free_spc);
h += ost.str().length();
#else
ostrstream ost;
inset->Latex(ost, -1, free_spc);
inset->Latex(ost, true, free_spc);
ost << '\0';
char * tmp = ost.str();
string tstr(tmp);
@ -1445,7 +1445,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
WriteFSAlert(_("Error: Cannot open temporary file:"), fname1);
return;
}
inset->Latex(fs, -1, free_spc);
inset->Latex(fs, true, free_spc);
h += fs.tellp() - 1;
::remove(fname1.c_str());
#endif
@ -1530,7 +1530,7 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
case LyXParagraph::META_INSET:
if ((inset = par->GetInset(i))) {
fpos = ofs.tellp();
inset->Latex(ofs, -1, free_spc);
inset->Latex(ofs, true, free_spc);
currlinelen += (ofs.tellp() - fpos);
actpos += (ofs.tellp() - fpos) - 1;
}
@ -3538,7 +3538,7 @@ void Buffer::RoffAsciiTable(ostream & os, LyXParagraph * par)
#if 1
#ifdef HAVE_SSTREAM
stringstresm ss(ios::in | ios::out);
inset->Latex(ss, -1);
inset->Latex(ss, true);
ss.seekp(0);
ss.get(c);
while (!ss) {
@ -3550,7 +3550,7 @@ void Buffer::RoffAsciiTable(ostream & os, LyXParagraph * par)
}
#else
strstream ss;
inset->Latex(ss, -1);
inset->Latex(ss, true);
ss.seekp(0);
ss.get(c);
while (!ss) {
@ -3571,7 +3571,7 @@ void Buffer::RoffAsciiTable(ostream & os, LyXParagraph * par)
remove(fname1.c_str());
return;
}
inset->Latex(fs, -1);
inset->Latex(fs, true);
fs.seekp(0);
fs.get(c);
while(!fs) {

View File

@ -1142,7 +1142,7 @@ void InsetFig::Read(LyXLex & lex)
int InsetFig::Latex(ostream & os,
signed char /* fragile*/, bool /* fs*/) const
bool /* fragile*/, bool /* fs*/) const
{
Regenerate();
if (!cmd.empty()) os << cmd << " ";

View File

@ -37,7 +37,7 @@ public:
///
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_space) const;
int Latex(std::ostream &, bool fragile, bool free_space) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -323,7 +323,7 @@ string InsetBibtex::getScreenLabel() const
int InsetBibtex::Latex(ostream & os,
signed char /*fragile*/, bool/*fs*/) const
bool /*fragile*/, bool/*fs*/) const
{
// this looks like an horrible hack and it is :) The problem
// is that owner is not initialized correctly when the bib

View File

@ -133,7 +133,7 @@ public:
///
void Edit(BufferView *, int x, int y, unsigned int button);
///
int Latex(std::ostream &, signed char, bool) const;
int Latex(std::ostream &, bool fragile, bool freespace) const;
///
string getKeys(char delim);
///

View File

@ -197,7 +197,7 @@ void InsetCommand::Read(LyXLex & lex)
}
int InsetCommand::Latex(ostream & os, signed char /*fragile*/, bool/*fs*/) const
int InsetCommand::Latex(ostream & os, bool /*fragile*/, bool/*fs*/) const
{
os << getCommand();
return 0;

View File

@ -49,7 +49,7 @@ public:
void Read(LyXLex & lex);
///
virtual int Latex(std::ostream &,
signed char fragile, bool free_spc) const;
bool fragile, bool free_spc) const;
///
virtual int Linuxdoc(std::ostream &) const;
///

View File

@ -105,7 +105,7 @@ void InsetError::Read(LyXLex &)
int InsetError::Latex(ostream &,
signed char /*fragile*/, bool /*fs*/) const
bool /*fragile*/, bool /*fs*/) const
{
return 0;
}

View File

@ -48,7 +48,7 @@ public:
///
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -52,7 +52,7 @@ char const * InsetFoot::EditMessage() const
}
int InsetFoot::Latex(ostream & os, signed char fragile, bool fp) const
int InsetFoot::Latex(ostream & os, bool fragile, bool fp) const
{
if (fragile)
os << "\\footnote{"; // was footnotemark but that won't work

View File

@ -37,7 +37,7 @@ public:
///
Inset::Code LyxCode() const { return Inset::FOOT_CODE; }
///
int Latex(std::ostream &, signed char, bool fp) const;
int Latex(std::ostream &, bool fragile, bool fp) const;
///
void Write(std::ostream &) const;
///

View File

@ -192,7 +192,7 @@ void InsetGraphics::Read(LyXLex & /*lex*/)
int InsetGraphics::Latex(ostream & os,
signed char /*fragile*/, bool/*fs*/) const
bool /*fragile*/, bool/*fs*/) const
{
// MISSING: We have to decide how to do the order of the options
// that is depentant of order, like witdth, height, andlge. Should

View File

@ -46,10 +46,10 @@ public:
///
void Read(LyXLex & lex);
/** returns the number of rows (\n's) of generated tex code.
fragile != 0 means, that the inset should take care about
fragile == true means, that the inset should take care about
fragile commands by adding a \protect before.
*/
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -333,7 +333,7 @@ bool InsetInclude::loadIfNeeded() const
int InsetInclude::Latex(ostream & os,
signed char /*fragile*/, bool /*fs*/) const
bool /*fragile*/, bool /*fs*/) const
{
// Do nothing if no file name has been specified
if (contents.empty())

View File

@ -58,7 +58,7 @@ public:
///
void Read(LyXLex &);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
void Validate(LaTeXFeatures &) const;

View File

@ -133,7 +133,7 @@ void InsetInfo::Read(LyXLex & lex)
int InsetInfo::Latex(ostream &,
signed char /*fragile*/, bool /*free_spc*/) const
bool /*fragile*/, bool /*free_spc*/) const
{
return 0;
}

View File

@ -50,7 +50,7 @@ public:
///
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -47,7 +47,7 @@ string InsetLabel::getLabel(int) const
int InsetLabel::Latex(ostream & os,
signed char /*fragile*/, bool /*fs*/) const
bool /*fragile*/, bool /*fs*/) const
{
os << escape(getCommand());
return 0;

View File

@ -40,7 +40,7 @@ public:
///
EDITABLE Editable() const { return NOT_EDITABLE; }
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -620,7 +620,7 @@ void InsetLatexAccent::Read(LyXLex & lex)
int InsetLatexAccent::Latex(ostream & os,
signed char /*fragile*/, bool/*fs*/) const
bool /*fragile*/, bool/*fs*/) const
{
os << contents;
return 0;

View File

@ -54,7 +54,7 @@ public:
///
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -52,7 +52,7 @@ void InsetParent::Edit(BufferView * bv, int, int, unsigned int)
// LaTeX must just ignore this command
int InsetParent::Latex(ostream & os,
signed char fragile, bool free_spc) const
bool fragile, bool free_spc) const
{
os << "%%#{lyx}";
InsetCommand::Latex(os, fragile, free_spc);

View File

@ -33,7 +33,7 @@ public:
explicit
InsetParent(string const & fn, Buffer * owner = 0);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
Inset * Clone() const { return new InsetParent(getContents()); }
///

View File

@ -224,7 +224,7 @@ void InsetQuotes::Read(LyXLex & lex)
}
int InsetQuotes::Latex(ostream & os, signed char /*fragile*/, bool) const
int InsetQuotes::Latex(ostream & os, bool /*fragile*/, bool) const
{
string doclang =
current_view->buffer()->GetLanguage();

View File

@ -86,7 +86,7 @@ public:
///
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -70,7 +70,7 @@ string InsetRef::getScreenLabel() const
int InsetRef::Latex(ostream & os,
signed char /*fragile*/, bool /*fs*/) const
bool /*fragile*/, bool /*fs*/) const
{
if(getOptions().empty())
os << escape(getCommand());

View File

@ -61,7 +61,7 @@ public:
///
void gotoLabel();
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -177,7 +177,7 @@ void InsetSpecialChar::Read(LyXLex & lex)
}
int InsetSpecialChar::Latex(ostream & os, signed char /*fragile*/,
int InsetSpecialChar::Latex(ostream & os, bool /*fragile*/,
bool free_space) const
{
switch (kind) {

View File

@ -56,7 +56,7 @@ public:
/// Will not be used when lyxf3
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -718,7 +718,7 @@ InsetText::LocalDispatch(BufferView * bv,
}
int InsetText::Latex(ostream & os, signed char /*fragile*/, bool) const
int InsetText::Latex(ostream & os, bool /*fragile*/, bool) const
{
TexRow texrow;
int ret = par->SimpleTeXOnePar(os, texrow);

View File

@ -78,7 +78,7 @@ public:
///
UpdatableInset::RESULT LocalDispatch(BufferView *, int, string const &);
///
int Latex(std::ostream &, signed char, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const { return 0; }
///

View File

@ -174,7 +174,7 @@ string InsetUrl::getScreenLabel() const
int InsetUrl::Latex(ostream & os,
signed char fragile, bool /*free_spc*/) const
bool fragile, bool /*free_spc*/) const
{
if (!getOptions().empty())
os << getOptions() + ' ';

View File

@ -72,7 +72,7 @@ public:
///
void gotoLabel();
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -129,12 +129,12 @@ public:
///
virtual void Read(LyXLex & lex) = 0;
/** returns the number of rows (\n's) of generated tex code.
fragile != 0 means, that the inset should take care about
fragile == true means, that the inset should take care about
fragile commands by adding a \protect before.
If the free_spc (freespacing) variable is set, then this inset
is in a free-spacing paragraph.
*/
virtual int Latex(std::ostream &, signed char fragile,
virtual int Latex(std::ostream &, bool fragile,
bool free_spc) const = 0;
///

View File

@ -1117,9 +1117,8 @@ string LyXFunc::Dispatch(int ac,
// Pretend we got the name instead.
Dispatch(int(LFUN_LAYOUT),
textclasslist.NameOfLayout(owner->view()->
text->bparams->
textclass,
textclasslist.NameOfLayout(owner->view()
->buffer()->params.textclass,
sel).c_str());
return string();
}
@ -1132,7 +1131,7 @@ string LyXFunc::Dispatch(int ac,
// Derive layout number from given argument (string)
// and current buffer's textclass (number). */
LyXTextClassList::ClassList::size_type tclass =
owner->view()->text->bparams->textclass;
owner->view()->buffer()->params.textclass;
pair <bool, LyXTextClass::size_type> layout =
textclasslist.NumberOfLayout(tclass, argument);

View File

@ -58,7 +58,7 @@ public:
~LyXText();
/// points to Buffer.params
BufferParams * bparams;
//BufferParams * bparams;
/// points to Buffer
Buffer * buffer;
///

View File

@ -308,16 +308,16 @@ Inset * InsetFormula::Clone() const
void InsetFormula::Write(ostream & os) const
{
os << "Formula ";
Latex(os, 0, 0);
Latex(os, false, false);
}
int InsetFormula::Latex(ostream & os, signed char fragile, bool) const
int InsetFormula::Latex(ostream & os, bool fragile, bool) const
{
int ret = 0;
//#warning Alejandro, the number of lines is not returned in this case
// This problem will disapear at 0.13.
if (fragile < 0)
if (fragile) // this is where fragile != 0 was used (Lgb)
par->Write(os, fragile);
else
mathed_write(par, os, &ret, fragile, label.c_str());

View File

@ -52,7 +52,7 @@ public:
///
void Read(LyXLex & lex);
///
int Latex(std::ostream &, signed char fragile, bool free_spc) const;
int Latex(std::ostream &, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -69,14 +69,18 @@ Inset * InsetFormulaMacro::Clone() const
void InsetFormulaMacro::Write(ostream & os) const
{
os << "FormulaMacro ";
tmacro->WriteDef(os, 0);
tmacro->WriteDef(os, false);
}
int InsetFormulaMacro::Latex(ostream & os, signed char /*fragile*/,
int InsetFormulaMacro::Latex(ostream & os, bool /*fragile*/,
bool /*free_spacing*/) const
{
tmacro->WriteDef(os, 1);
tmacro->WriteDef(os, true); // or false?
// CHECK
// This is the only place where a '1' is used rather that '-1' or '0'
// for value of fragile. What is the reason behind it and does it make
// a difference? (Lgb)
return 1;
}

View File

@ -49,7 +49,7 @@ public:
///
void Write(std::ostream & os) const;
///
int Latex(std::ostream & os, signed char fragile, bool free_spc) const;
int Latex(std::ostream & os, bool fragile, bool free_spc) const;
///
int Linuxdoc(std::ostream &) const;
///

View File

@ -231,7 +231,7 @@ class MathedInset {
virtual void draw(Painter &, int x, int baseline) = 0;
/// Write LaTeX and Lyx code
virtual void Write(std::ostream &, signed char fragile) = 0;
virtual void Write(std::ostream &, bool fragile) = 0;
/// Reproduces itself
virtual MathedInset * Clone() = 0;
@ -329,7 +329,7 @@ class MathParInset: public MathedInset {
virtual void draw(Painter &, int x, int baseline);
/// Write LaTeX code
virtual void Write(std::ostream &, signed char fragile);
virtual void Write(std::ostream &, bool fragile);
///
virtual void Metrics();
@ -488,7 +488,7 @@ class MathMatrixInset: public MathParInset {
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///
@ -535,7 +535,7 @@ class MathMatrixInset: public MathParInset {
LyxArrayBase * mathed_parse(unsigned flags, LyxArrayBase * data,
MathParInset ** mt);
///
void mathed_write(MathParInset *, std::ostream &, int *, signed char fragile,
void mathed_write(MathParInset *, std::ostream &, int *, bool fragile,
char const * label = 0);
///

View File

@ -46,7 +46,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///
@ -75,7 +75,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///
@ -105,7 +105,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
protected:
@ -124,7 +124,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
inline void Metrics();
///
@ -147,7 +147,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///
@ -174,7 +174,7 @@ public:
///
void draw(Painter &, int x, int baseline);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///
@ -197,7 +197,7 @@ public:
///
void draw(Painter &, int x, int baseline);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
@ -243,7 +243,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
protected:
@ -264,7 +264,7 @@ public:
///
void draw(Painter &, int, int);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///
@ -297,7 +297,7 @@ bool MathFuncInset::GetLimits() const
inline
void MathFuncInset::Write(std::ostream & os, signed char /* fragile */)
void MathFuncInset::Write(std::ostream & os, bool /* fragile */)
{
os << "\\" << name << ' ';
}

View File

@ -158,7 +158,7 @@ void MathMacro::SetFocus(int x, int y)
}
void MathMacro::Write(ostream & os, signed char fragile)
void MathMacro::Write(ostream & os, bool fragile)
{
if (tmplate->flags & MMF_Exp) {
lyxerr[Debug::MATHED] << "Expand " << tmplate->flags
@ -261,7 +261,7 @@ void MathMacroArgument::Metrics()
}
void MathMacroArgument::Write(ostream & os, signed char fragile)
void MathMacroArgument::Write(ostream & os, bool fragile)
{
if (expnd_mode) {
MathParInset::Write(os, fragile);
@ -375,7 +375,7 @@ void MathMacroTemplate::update(MathMacro * macro)
}
void MathMacroTemplate::WriteDef(ostream & os, signed char fragile)
void MathMacroTemplate::WriteDef(ostream & os, bool fragile)
{
os << "\n\\newcommand{\\" << name << "}";

View File

@ -51,7 +51,7 @@ public:
///
MathedInset * Clone();
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
bool setArgumentIdx(int);
///
@ -118,7 +118,7 @@ public:
///
void draw(Painter &, int x, int baseline);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void setNumber(int n) { number = n; }
/// Is expanded or not
@ -146,7 +146,7 @@ public:
///
void Metrics();
///
void WriteDef(std::ostream &, signed char fragile);
void WriteDef(std::ostream &, bool fragile);
/// useful for special insets
void setTCode(MathedTextCodes t) { tcode = t; }
///

View File

@ -137,7 +137,7 @@ void MathRootInset::SetFocus(int x, int)
}
void MathRootInset::Write(ostream & os, signed char fragile)
void MathRootInset::Write(ostream & os, bool fragile)
{
os << '\\' << name << '[';
uroot->Write(os, fragile);

View File

@ -40,7 +40,7 @@ class MathRootInset: public MathSqrtInset {
///
void draw(Painter &, int x, int baseline);
///
void Write(std::ostream &, signed char fragile);
void Write(std::ostream &, bool fragile);
///
void Metrics();
///

View File

@ -45,7 +45,7 @@ char const * math_font_name[] = {
void
MathSpaceInset::Write(ostream & os, signed char /* fragile */)
MathSpaceInset::Write(ostream & os, bool /* fragile */)
{
if (space >= 0 && space < 6) {
os << '\\' << latex_mathspace[space] << ' ';
@ -54,13 +54,13 @@ MathSpaceInset::Write(ostream & os, signed char /* fragile */)
void
MathDotsInset::Write(ostream & os, signed char /* fragile */)
MathDotsInset::Write(ostream & os, bool /* fragile */)
{
os << '\\' << name << ' ';
}
void MathSqrtInset::Write(ostream & os, signed char fragile)
void MathSqrtInset::Write(ostream & os, bool fragile)
{
os << '\\' << name << '{';
MathParInset::Write(os, fragile);
@ -68,7 +68,7 @@ void MathSqrtInset::Write(ostream & os, signed char fragile)
}
void MathDelimInset::Write(ostream & os, signed char fragile)
void MathDelimInset::Write(ostream & os, bool fragile)
{
latexkeys * l = (left != '|') ? lm_get_key_by_id(left, LM_TK_SYM): 0;
latexkeys * r = (right != '|') ? lm_get_key_by_id(right, LM_TK_SYM): 0;
@ -96,7 +96,7 @@ void MathDelimInset::Write(ostream & os, signed char fragile)
}
void MathDecorationInset::Write(ostream & os, signed char fragile)
void MathDecorationInset::Write(ostream & os, bool fragile)
{
latexkeys * l = lm_get_key_by_id(deco, LM_TK_WIDE);
os << '\\' << l->name << '{';
@ -105,7 +105,7 @@ void MathDecorationInset::Write(ostream & os, signed char fragile)
}
void MathAccentInset::Write(ostream & os, signed char fragile)
void MathAccentInset::Write(ostream & os, bool fragile)
{
latexkeys * l = lm_get_key_by_id(code, LM_TK_ACCENT);
os << '\\' << l->name;
@ -139,7 +139,7 @@ void MathAccentInset::Write(ostream & os, signed char fragile)
}
void MathBigopInset::Write(ostream & os, signed char /* fragile */)
void MathBigopInset::Write(ostream & os, bool /* fragile */)
{
bool limp = GetLimits();
@ -157,7 +157,7 @@ void MathBigopInset::Write(ostream & os, signed char /* fragile */)
}
void MathFracInset::Write(ostream & os, signed char fragile)
void MathFracInset::Write(ostream & os, bool fragile)
{
os << '\\' << name << '{';
MathParInset::Write(os, fragile);
@ -167,7 +167,7 @@ void MathFracInset::Write(ostream & os, signed char fragile)
}
void MathParInset::Write(ostream & os, signed char fragile)
void MathParInset::Write(ostream & os, bool fragile)
{
if (!array) return;
int brace = 0;
@ -288,7 +288,7 @@ void MathParInset::Write(ostream & os, signed char fragile)
}
void MathMatrixInset::Write(ostream & os, signed char fragile)
void MathMatrixInset::Write(ostream & os, bool fragile)
{
if (GetType() == LM_OT_MATRIX){
if (fragile)
@ -320,7 +320,7 @@ void MathMatrixInset::Write(ostream & os, signed char fragile)
void mathed_write(MathParInset * p, ostream & os, int * newlines,
signed char fragile, char const * label)
bool fragile, char const * label)
{
number_of_newlines = 0;
short mathed_env = p->GetType();

View File

@ -1980,8 +1980,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
if (!spacing.isDefault()
&& (!Previous() || !Previous()->HasSameLayout(this))) {
os << "\\begin{spacing}{"
<< spacing.getValue() << "}\n";
os << spacing.writeEnvirBegin() << "\n";
texrow.newline();
}
@ -2163,7 +2162,7 @@ LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
if (!spacing.isDefault()
&& (!par || !par->HasSameLayout(this))) {
os << "\\end{spacing}\n";
os << spacing.writeEnvirEnd() << "\n";
texrow.newline();
}
@ -3405,7 +3404,7 @@ bool LyXParagraph::RoffContTableRows(ostream & os,
#if 1
#ifdef HAVE_SSTREAM
stringstream ss(ios::in | ios::out);
inset->Latex(ss, -1);
inset->Latex(ss, true);
ss.seekp(0);
ss.get(c);
while (!ss) {
@ -3417,7 +3416,7 @@ bool LyXParagraph::RoffContTableRows(ostream & os,
}
#else
strstream ss;
inset->Latex(ss, -1);
inset->Latex(ss, true);
ss.seekp(0);
ss.get(c);
while (!ss) {
@ -3438,7 +3437,7 @@ bool LyXParagraph::RoffContTableRows(ostream & os,
fname2);
return false;
}
inset->Latex(fs, -1);
inset->Latex(fs, true);
fs.seekp(0);
fs.get(c);
while (!fs) {

View File

@ -21,7 +21,7 @@
#include "lyxrow.h"
#include "Painter.h"
#include "WorkArea.h"
#include "bufferparams.h"
#include "buffer.h"
#include "font.h"
using std::max;
@ -190,9 +190,9 @@ void LyXScreen::ShowCursor()
if (!cursor_visible) {
Cursor_Shape shape = BAR_SHAPE;
if (text->real_current_font.language() !=
text->bparams->language_info
text->buffer->params.language_info
|| text->real_current_font.isVisibleRightToLeft()
!= text->bparams->language_info->RightToLeft)
!= text->buffer->params.language_info->RightToLeft)
shape = (text->real_current_font.isVisibleRightToLeft())
? REVERSED_L_SHAPE : L_SHAPE;
ShowManualCursor(text->cursor.x, text->cursor.y,

View File

@ -565,7 +565,8 @@ void LyXText::draw(Row const * row,
// exactly the label-width.
int LyXText::LeftMargin(Row const * row) const
{
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout =
textclasslist.Style(buffer->params.textclass,
row->par->GetLayout());
string parindent = layout.parindent;
@ -578,10 +579,10 @@ int LyXText::LeftMargin(Row const * row) const
int x = LYX_PAPER_MARGIN;
x += lyxfont::signedWidth(textclasslist
.TextClass(bparams->textclass)
.TextClass(buffer->params.textclass)
.leftmargin(),
textclasslist
.TextClass(bparams->textclass)
.TextClass(buffer->params.textclass)
.defaultfont());
if (row->par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
@ -601,7 +602,7 @@ int LyXText::LeftMargin(Row const * row) const
LyXParagraph * newpar = row->par
->DepthHook(row->par->GetDepth());
if (newpar &&
textclasslist.Style(bparams->textclass,
textclasslist.Style(buffer->params.textclass,
newpar->GetLayout())
.nextnoindent)
parindent.clear();
@ -617,7 +618,7 @@ int LyXText::LeftMargin(Row const * row) const
// check wether it is a sufficent paragraph
if (newpar && newpar->footnoteflag == row->par->footnoteflag
&& textclasslist
.Style(bparams->textclass,
.Style(buffer->params.textclass,
newpar->GetLayout()).isEnvironment()) {
Row dummyrow;
dummyrow.par = newpar;
@ -636,7 +637,7 @@ int LyXText::LeftMargin(Row const * row) const
parindent.clear();
else
parindent = textclasslist
.Style(bparams->textclass,
.Style(buffer->params.textclass,
newpar->GetLayout()).parindent;
}
@ -648,7 +649,7 @@ int LyXText::LeftMargin(Row const * row) const
if (!layout.leftmargin.empty()) {
x += lyxfont::signedWidth(layout.leftmargin,
textclasslist
.TextClass(bparams->
.TextClass(buffer->params.
textclass)
.defaultfont());
}
@ -670,7 +671,7 @@ int LyXText::LeftMargin(Row const * row) const
}
break;
case MARGIN_STATIC:
x += lyxfont::signedWidth(layout.leftmargin, textclasslist.TextClass(bparams->textclass).defaultfont()) * 4
x += lyxfont::signedWidth(layout.leftmargin, textclasslist.TextClass(buffer->params.textclass).defaultfont()) * 4
/ (row->par->GetDepth() + 4);
break;
case MARGIN_FIRST_DYNAMIC:
@ -718,7 +719,7 @@ int LyXText::LeftMargin(Row const * row) const
x += lyxfont::signedWidth(layout.leftmargin,
textclasslist
.TextClass(bparams->textclass)
.TextClass(buffer->params.textclass)
.defaultfont());
x += minfill;
}
@ -758,19 +759,19 @@ int LyXText::LeftMargin(Row const * row) const
&& align == LYX_ALIGN_BLOCK
&& !row->par->noindent
&& (row->par->layout ||
bparams->paragraph_separation ==
buffer->params.paragraph_separation ==
BufferParams::PARSEP_INDENT))
x += lyxfont::signedWidth(parindent,
textclasslist
.TextClass(bparams
->textclass)
.TextClass(buffer->params
.textclass)
.defaultfont());
else if (layout.labeltype == LABEL_BIBLIO) {
// ale970405 Right width for bibitems
x += bibitemMaxWidth(owner_->painter(),
textclasslist
.TextClass(bparams
->textclass)
.TextClass(buffer->params
.textclass)
.defaultfont());
}
}
@ -781,15 +782,15 @@ int LyXText::LeftMargin(Row const * row) const
int LyXText::RightMargin(Row const * row) const
{
LyXLayout const & layout =
textclasslist.Style(bparams->textclass,
textclasslist.Style(buffer->params.textclass,
row->par->GetLayout());
int x = LYX_PAPER_MARGIN
+ lyxfont::signedWidth(textclasslist
.TextClass(bparams->textclass)
.TextClass(buffer->params.textclass)
.rightmargin(),
textclasslist
.TextClass(bparams->textclass)
.TextClass(buffer->params.textclass)
.defaultfont());
if (row->par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
@ -815,7 +816,7 @@ int LyXText::RightMargin(Row const * row) const
// check wether it is a sufficent paragraph
if (newpar && newpar->footnoteflag == row->par->footnoteflag
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
newpar->GetLayout())
.isEnvironment()) {
Row dummyrow;
@ -832,7 +833,7 @@ int LyXText::RightMargin(Row const * row) const
}
//lyxerr << "rightmargin: " << layout->rightmargin << endl;
x += lyxfont::signedWidth(layout.rightmargin, textclasslist.TextClass(bparams->textclass).defaultfont()) * 4
x += lyxfont::signedWidth(layout.rightmargin, textclasslist.TextClass(buffer->params.textclass).defaultfont()) * 4
/ (row->par->GetDepth() + 4);
return x;
}
@ -840,7 +841,7 @@ int LyXText::RightMargin(Row const * row) const
int LyXText::LabelEnd (Row const * row) const
{
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
row->par->GetLayout()).margintype
== MARGIN_MANUAL) {
Row tmprow;
@ -935,7 +936,7 @@ LyXText::NextBreakPoint(Row const * row, int width) const
LyXParagraph::size_type main_body = BeginningOfMainBody(par);
LyXLayout const & layout =
textclasslist.Style(bparams->textclass, par->GetLayout());
textclasslist.Style(buffer->params.textclass, par->GetLayout());
LyXParagraph::size_type i = pos;
if (layout.margintype == MARGIN_RIGHT_ADDRESS_BOX) {
@ -1053,7 +1054,7 @@ int LyXText::Fill(Row const * row, int paper_width) const
/* table stuff -- end*/
// special handling of the right address boxes
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
row->par->GetLayout()).margintype
== MARGIN_RIGHT_ADDRESS_BOX) {
int tmpfill = row->fill;
@ -1063,7 +1064,7 @@ int LyXText::Fill(Row const * row, int paper_width) const
} else
w = LeftMargin(row);
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout = textclasslist.Style(buffer->params.textclass,
row->par->GetLayout());
LyXParagraph::size_type main_body =
BeginningOfMainBody(row->par);
@ -1213,7 +1214,7 @@ bool LyXText::HfillExpansion(Row const * row_ptr,
return true;
// in some labels it does not count
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
row_ptr->par->GetLayout()).margintype
!= MARGIN_MANUAL
&& pos < BeginningOfMainBody(row_ptr->par))
@ -1257,7 +1258,7 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
LyXParagraph * par = row_ptr->par->LastPhysicalPar();
LyXParagraph * firstpar = row_ptr->par->FirstPhysicalPar();
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout = textclasslist.Style(buffer->params.textclass,
firstpar->GetLayout());
LyXFont font = GetFont(par, par->Last() - 1);
@ -1271,7 +1272,7 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
if (!row_ptr->par->spacing.isDefault()) {
spacing_val = row_ptr->par->spacing.getValue();
} else {
spacing_val = bparams->spacing.getValue();
spacing_val = buffer->params.spacing.getValue();
}
//lyxerr << "spacing_val = " << spacing_val << endl;
@ -1337,17 +1338,17 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
&& row_ptr->par == firstpar) {
/* some parksips VERY EASY IMPLEMENTATION */
if (bparams->paragraph_separation == BufferParams::PARSEP_SKIP) {
if (buffer->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
if (layout.isParagraph()
&& firstpar->GetDepth() == 0
&& firstpar->Previous())
maxasc += bparams->getDefSkip().inPixels(owner_);
maxasc += buffer->params.getDefSkip().inPixels(owner_);
else if (firstpar->Previous()
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
firstpar->Previous()->GetLayout()).isParagraph()
&& firstpar->Previous()->GetDepth() == 0)
// is it right to use defskip here too? (AS)
maxasc += bparams->getDefSkip().inPixels(owner_);
maxasc += buffer->params.getDefSkip().inPixels(owner_);
}
/* the paper margins */
@ -1370,12 +1371,12 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
/* this is special code for the chapter, since the label of this
* layout is printed in an extra row */
if (layout.labeltype == LABEL_COUNTER_CHAPTER
&& bparams->secnumdepth>= 0) {
&& buffer->params.secnumdepth >= 0) {
float spacing_val = 1.0;
if (!row_ptr->par->spacing.isDefault()) {
spacing_val = row_ptr->par->spacing.getValue();
} else {
spacing_val = bparams->spacing.getValue();
spacing_val = buffer->params.spacing.getValue();
}
labeladdon = int(lyxfont::maxDescent(labelfont) *
@ -1396,7 +1397,7 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
if (!row_ptr->par->spacing.isDefault()) {
spacing_val = row_ptr->par->spacing.getValue();
} else {
spacing_val = bparams->spacing.getValue();
spacing_val = buffer->params.spacing.getValue();
}
labeladdon = int(
@ -1427,7 +1428,7 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
tmptop = layout.topsep;
if (row_ptr->previous->par->GetDepth() >= row_ptr->par->GetDepth())
tmptop-= textclasslist.Style(bparams->textclass, row_ptr->previous->par->GetLayout()).bottomsep;
tmptop-= textclasslist.Style(buffer->params.textclass, row_ptr->previous->par->GetLayout()).bottomsep;
if (tmptop > 0)
layoutasc = (tmptop * DefaultHeight());
@ -1441,7 +1442,7 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
prev = row_ptr->par->DepthHook(row_ptr->par->GetDepth()-1);
if (prev) {
maxasc += int(textclasslist.Style(bparams->textclass,
maxasc += int(textclasslist.Style(buffer->params.textclass,
prev->GetLayout()).parsep * DefaultHeight());
}
else {
@ -1487,12 +1488,12 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
float unusual = 0;
if (comparepar->GetDepth() > nextpar->GetDepth()) {
usual = (textclasslist.Style(bparams->textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
usual = (textclasslist.Style(buffer->params.textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
comparepar = comparepar->DepthHook(nextpar->GetDepth());
if (comparepar->GetLayout()!= nextpar->GetLayout()
|| nextpar->GetLabelWidthString() !=
comparepar->GetLabelWidthString())
unusual = (textclasslist.Style(bparams->textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
unusual = (textclasslist.Style(buffer->params.textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
if (unusual > usual)
layoutdesc = unusual;
@ -1504,7 +1505,7 @@ void LyXText::SetHeightOfRow(Row * row_ptr) const
if (comparepar->GetLayout()!= nextpar->GetLayout()
|| nextpar->GetLabelWidthString() !=
comparepar->GetLabelWidthString())
layoutdesc = int(textclasslist.Style(bparams->textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
layoutdesc = int(textclasslist.Style(buffer->params.textclass, comparepar->GetLayout()).bottomsep * DefaultHeight());
}
}
}
@ -1654,7 +1655,7 @@ void LyXText::BreakAgainOneRow(Row * row)
void LyXText::BreakParagraph(char keep_layout)
{
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout = textclasslist.Style(buffer->params.textclass,
cursor.par->GetLayout());
/* table stuff -- begin */
@ -2548,7 +2549,7 @@ void LyXText::InsertChar(char c)
* disable the double-space checking */
bool freeSpacing =
textclasslist.Style(bparams->textclass,
textclasslist.Style(buffer->params.textclass,
cursor.row->par->GetLayout()).free_spacing;
/* table stuff -- begin*/
@ -2761,7 +2762,7 @@ void LyXText::InsertChar(char c)
RedoHeightOfParagraph(cursor);
} else {
/* now the special right address boxes */
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
cursor.par->GetLayout()).margintype
== MARGIN_RIGHT_ADDRESS_BOX) {
RedoDrawingOfParagraph(cursor);
@ -2812,9 +2813,9 @@ void LyXText::PrepareToPrint(Row * row, float & x,
x = LeftMargin(row);
/* is there a manual margin with a manual label */
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
row->par->GetLayout()).margintype == MARGIN_MANUAL
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
row->par->GetLayout()).labeltype == LABEL_MANUAL) {
nlh = NumberOfLabelHfills(row) + 1; /* one more since labels
@ -2842,7 +2843,7 @@ void LyXText::PrepareToPrint(Row * row, float & x,
* set x how you need it */
int align;
if (row->par->FirstPhysicalPar()->align == LYX_ALIGN_LAYOUT)
align = textclasslist.Style(bparams->textclass, row->par->GetLayout()).align;
align = textclasslist.Style(buffer->params.textclass, row->par->GetLayout()).align;
else
align = row->par->FirstPhysicalPar()->align;
@ -2885,7 +2886,7 @@ void LyXText::PrepareToPrint(Row * row, float & x,
if (main_body > 0 &&
(main_body-1 > last ||
!row->par->IsLineSeparator(main_body-1))) {
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout = textclasslist.Style(buffer->params.textclass,
row->par->GetLayout());
x += lyxfont::width(layout.labelsep,
GetFont(row->par, -2));
@ -3112,7 +3113,7 @@ char * LyXText::SelectNextWord(float & value)
&& (cursor.par->IsLetter(cursor.pos))
|| (cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET
&& cursor.par->GetInset(cursor.pos) != 0
&& cursor.par->GetInset(cursor.pos)->Latex(latex, 0, false) == 0
&& cursor.par->GetInset(cursor.pos)->Latex(latex, false, false) == 0
#ifdef HAVE_SSTREAM
&& latex.str() == "\\-"
#else
@ -3160,7 +3161,7 @@ void LyXText::SelectSelectedWord()
&& (cursor.par->IsLetter(cursor.pos)
|| (cursor.par->GetChar(cursor.pos) == LyXParagraph::META_INSET
&& cursor.par->GetInset(cursor.pos) != 0
&& cursor.par->GetInset(cursor.pos)->Latex(latex, 0, false) == 0
&& cursor.par->GetInset(cursor.pos)->Latex(latex, false, false) == 0
#ifdef HAVE_SSTREAM
&& latex.str() == "\\-"
#else
@ -3266,7 +3267,6 @@ void LyXText::ChangeWordCase(LyXText::TextCase action)
LyXParagraph::size_type tmppos =
cursor.par->PositionInParFromPos(cursor.pos);
while (tmppos < tmppar->size()) {
//unsigned char c = tmppar->text[tmppos];
unsigned char c = tmppar->GetChar(tmppos);
if (IsKommaChar(c) || IsLineSeparatorChar(c))
break;
@ -3663,7 +3663,7 @@ void LyXText::Backspace()
RedoHeightOfParagraph(cursor);
} else {
// now the special right address boxes
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
cursor.par->GetLayout()).margintype == MARGIN_RIGHT_ADDRESS_BOX) {
RedoDrawingOfParagraph(cursor);
}
@ -3789,7 +3789,7 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
float old_tmpx = tmpx;
if (main_body > 0 && pos == main_body-1) {
tmpx += fill_label_hfill +
lyxfont::width(textclasslist.Style(bparams->textclass,
lyxfont::width(textclasslist.Style(buffer->params.textclass,
row_ptr->par->GetLayout()).labelsep,
GetFont(row_ptr->par, -2));
if (row_ptr->par->IsLineSeparator(main_body-1))
@ -3936,7 +3936,7 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
}
LyXLayout const & layout =
textclasslist.Style(bparams->textclass,
textclasslist.Style(buffer->params.textclass,
row_ptr->par->GetLayout());
firstpar = row_ptr->par->FirstPhysicalPar();
@ -4006,17 +4006,17 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
/* think about the parskip */
/* some parskips VERY EASY IMPLEMENTATION */
if (bparams->paragraph_separation == BufferParams::PARSEP_SKIP) {
if (buffer->params.paragraph_separation == BufferParams::PARSEP_SKIP) {
if (layout.latextype == LATEX_PARAGRAPH
&& firstpar->GetDepth() == 0
&& firstpar->Previous())
y_top += bparams->getDefSkip().inPixels(owner_);
y_top += buffer->params.getDefSkip().inPixels(owner_);
else if (firstpar->Previous()
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
firstpar->Previous()->GetLayout()).latextype == LATEX_PARAGRAPH
&& firstpar->Previous()->GetDepth() == 0)
// is it right to use defskip here, too? (AS)
y_top += bparams->getDefSkip().inPixels(owner_);
y_top += buffer->params.getDefSkip().inPixels(owner_);
}
if (row_ptr->par->line_top) { /* draw a top line */
@ -4042,14 +4042,14 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
string tmpstring = row_ptr->par->GetLabelstring();
if (layout.labeltype == LABEL_COUNTER_CHAPTER) {
if (bparams->secnumdepth >= 0){
if (buffer->params.secnumdepth >= 0) {
/* this is special code for the chapter layout. This is printed in
* an extra row and has a pagebreak at the top. */
float spacing_val = 1.0;
if (!row_ptr->par->spacing.isDefault()) {
spacing_val = row_ptr->par->spacing.getValue();
} else {
spacing_val = bparams->spacing.getValue();
spacing_val = buffer->params.spacing.getValue();
}
maxdesc = int(lyxfont::maxDescent(font) * layout.spacing.getValue() * spacing_val)
@ -4092,7 +4092,7 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
if (!row_ptr->par->spacing.isDefault()) {
spacing_val = row_ptr->par->spacing.getValue();
} else {
spacing_val = bparams->spacing.getValue();
spacing_val = buffer->params.spacing.getValue();
}
maxdesc = int(lyxfont::maxDescent(font) * layout.spacing.getValue() * spacing_val
@ -4510,7 +4510,7 @@ int LyXText::GetColumnNearX(Row * row, int & x) const
LyXParagraph::size_type vc = row->pos;
LyXParagraph::size_type last = RowLastPrintable(row);
LyXParagraph::size_type c = 0;
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout = textclasslist.Style(buffer->params.textclass,
row->par->GetLayout());
/* table stuff -- begin */
if (row->par->table) {
@ -4720,7 +4720,7 @@ void LyXText::InsertFootnoteEnvironment(LyXParagraph::footnote_kind kind)
|| kind == LyXParagraph::WIDE_FIG
|| kind == LyXParagraph::ALGORITHM) {
pair<bool, LyXTextClass::size_type> lres =
textclasslist.NumberOfLayout(bparams->textclass,
textclasslist.NumberOfLayout(buffer->params.textclass,
"Caption");
LyXTextClass::size_type lay;
if (lres.first) {

View File

@ -55,7 +55,7 @@ LyXText::LyXText(BufferView * bv, int pw, Buffer * p)
currentrow = 0;
currentrow_y = 0;
paperwidth = pw;
bparams = &p->params;
//bparams = &p->params;
buffer = p;
number_of_rows = 0;
refresh_y = 0;
@ -120,7 +120,8 @@ LyXFont LyXText::GetFont(LyXParagraph * par,
LyXParagraph::size_type pos) const
{
LyXLayout const & layout =
textclasslist.Style(bparams->textclass, par->GetLayout());
textclasslist.Style(buffer->params.textclass,
par->GetLayout());
char par_depth = par->GetDepth();
// We specialize the 95% common case:
@ -174,13 +175,13 @@ LyXFont LyXText::GetFont(LyXParagraph * par,
par = par->DepthHook(par_depth - 1);
if (par) {
tmpfont.realize(textclasslist.
Style(bparams->textclass,
Style(buffer->params.textclass,
par->GetLayout()).font);
par_depth = par->GetDepth();
}
}
tmpfont.realize(textclasslist.TextClass(bparams->textclass).defaultfont());
tmpfont.realize(textclasslist.TextClass(buffer->params.textclass).defaultfont());
// Cosmetic improvement: If this is an open footnote, make the font
// smaller.
@ -204,7 +205,8 @@ void LyXText::SetCharFont(LyXParagraph * par,
font = par->GetInset(pos)->ConvertFont(font);
}
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout =
textclasslist.Style(buffer->params.textclass,
par->GetLayout());
// Get concrete layout font to reduce against
@ -222,12 +224,12 @@ void LyXText::SetCharFont(LyXParagraph * par,
tp = tp->DepthHook(tp->GetDepth()-1);
if (tp)
layoutfont.realize(textclasslist.
Style(bparams->textclass,
Style(buffer->params.textclass,
tp->GetLayout()).font);
}
}
layoutfont.realize(textclasslist.TextClass(bparams->textclass).defaultfont());
layoutfont.realize(textclasslist.TextClass(buffer->params.textclass).defaultfont());
if (par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
&& par->footnotekind == LyXParagraph::FOOTNOTE) {
@ -448,7 +450,8 @@ void LyXText::MakeFontEntriesLayoutSpecific(LyXParagraph * par)
{
LyXLayout const & layout =
textclasslist.Style(bparams->textclass, par->GetLayout());
textclasslist.Style(buffer->params.textclass,
par->GetLayout());
LyXFont layoutfont, tmpfont;
for (LyXParagraph::size_type pos = 0;
@ -501,7 +504,7 @@ void LyXText::SetLayout(LyXTextClass::size_type layout)
cursor = sel_start_cursor;
LyXLayout const & lyxlayout =
textclasslist.Style(bparams->textclass, layout);
textclasslist.Style(buffer->params.textclass, layout);
while (cursor.par != sel_end_cursor.par) {
if (cursor.par->footnoteflag ==
@ -596,7 +599,7 @@ void LyXText::IncDepth()
// NOTE: you can't change the depth of a bibliography entry
if (cursor.par->footnoteflag ==
sel_start_cursor.par->footnoteflag
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
cursor.par->GetLayout()
).labeltype != LABEL_BIBLIO) {
LyXParagraph * prev =
@ -604,7 +607,7 @@ void LyXText::IncDepth()
if (prev
&& (prev->GetDepth() - cursor.par->GetDepth() > 0
|| (prev->GetDepth() == cursor.par->GetDepth()
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
prev->GetLayout()).isEnvironment()))) {
cursor.par->FirstPhysicalPar()->depth++;
anything_changed = true;
@ -712,7 +715,9 @@ void LyXText::SetFont(LyXFont const & font, bool toggleall)
else
layoutfont = GetFont(cursor.par, -1);
// Update current font
real_current_font.update(font, bparams->language_info, toggleall);
real_current_font.update(font,
buffer->params.language_info,
toggleall);
// Reduce to implicit settings
current_font = real_current_font;
@ -741,7 +746,9 @@ void LyXText::SetFont(LyXFont const & font, bool toggleall)
// an open footnote should behave
// like a closed one
LyXFont newfont = GetFont(cursor.par, cursor.pos);
newfont.update(font, bparams->language_info, toggleall);
newfont.update(font,
buffer->params.language_info,
toggleall);
SetCharFont(cursor.par, cursor.pos, newfont);
cursor.pos++;
} else {
@ -1099,7 +1106,7 @@ void LyXText::ToggleFree(LyXFont const & font, bool toggleall)
LyXParagraph::size_type LyXText::BeginningOfMainBody(LyXParagraph * par) const
{
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
par->GetLayout()).labeltype != LABEL_MANUAL)
return 0;
else
@ -1146,7 +1153,7 @@ void LyXText::MeltFootnoteEnvironment()
tmppar->footnoteflag = LyXParagraph::NO_FOOTNOTE;
/* remember the captions and empty paragraphs */
if ((textclasslist.Style(bparams->textclass,
if ((textclasslist.Style(buffer->params.textclass,
tmppar->GetLayout())
.labeltype == LABEL_SENSITIVE)
|| !tmppar->Last())
@ -1260,13 +1267,13 @@ void LyXText::SetParagraph(bool line_top, bool line_bottom,
// does the layout allow the new alignment?
if (align == LYX_ALIGN_LAYOUT)
align = textclasslist
.Style(bparams->textclass,
.Style(buffer->params.textclass,
cursor.par->GetLayout()).align;
if (align & textclasslist
.Style(bparams->textclass,
.Style(buffer->params.textclass,
cursor.par->GetLayout()).alignpossible) {
if (align == textclasslist
.Style(bparams->textclass,
.Style(buffer->params.textclass,
cursor.par->GetLayout()).align)
cursor.par->align = LYX_ALIGN_LAYOUT;
else
@ -1403,11 +1410,12 @@ void LyXText::SetCounter(LyXParagraph * par) const
// this is only relevant for the beginning of paragraph
par = par->FirstPhysicalPar();
LyXLayout const & layout = textclasslist.Style(bparams->textclass,
LyXLayout const & layout =
textclasslist.Style(buffer->params.textclass,
par->GetLayout());
LyXTextClass const & textclass =
textclasslist.TextClass(bparams->textclass);
textclasslist.TextClass(buffer->params.textclass);
/* copy the prev-counters to this one, unless this is the start of a
footnote or of a bibliography or the very first paragraph */
@ -1415,7 +1423,7 @@ void LyXText::SetCounter(LyXParagraph * par) const
&& !(par->Previous()->footnoteflag == LyXParagraph::NO_FOOTNOTE
&& par->footnoteflag == LyXParagraph::OPEN_FOOTNOTE
&& par->footnotekind == LyXParagraph::FOOTNOTE)
&& !(textclasslist.Style(bparams->textclass,
&& !(textclasslist.Style(buffer->params.textclass,
par->Previous()->GetLayout()
).labeltype != LABEL_BIBLIO
&& layout.labeltype == LABEL_BIBLIO)) {
@ -1450,7 +1458,7 @@ void LyXText::SetCounter(LyXParagraph * par) const
&& par->Previous()
&& par->Previous()->footnoteflag != LyXParagraph::OPEN_FOOTNOTE
&& (par->PreviousBeforeFootnote()
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
par->PreviousBeforeFootnote()->GetLayout()
).labeltype >= LABEL_COUNTER_ENUMI)) {
// Any itemize or enumerate environment in a marginnote
@ -1472,7 +1480,7 @@ void LyXText::SetCounter(LyXParagraph * par) const
*/
if (par->Previous()
&& par->Previous()->GetDepth() < par->GetDepth()
&& textclasslist.Style(bparams->textclass,
&& textclasslist.Style(buffer->params.textclass,
par->Previous()->GetLayout()
).labeltype == LABEL_COUNTER_ENUMI
&& par->enumdepth < 3
@ -1516,7 +1524,7 @@ void LyXText::SetCounter(LyXParagraph * par) const
if (layout.labeltype >= LABEL_FIRST_COUNTER) {
int i = layout.labeltype - LABEL_FIRST_COUNTER;
if (i >= 0 && i<= bparams->secnumdepth) {
if (i >= 0 && i<= buffer->params.secnumdepth) {
par->incCounter(i); // increment the counter
// Is there a label? Useful for Chapter layout
@ -1805,8 +1813,10 @@ void LyXText::UpdateCounters(Row * row) const
/* now check for the headline layouts. remember that they
* have a dynamic left margin */
if (!par->IsDummy()
&& ( textclasslist.Style(bparams->textclass, par->layout).margintype == MARGIN_DYNAMIC
|| textclasslist.Style(bparams->textclass, par->layout).labeltype == LABEL_SENSITIVE)
&& ( textclasslist.Style(buffer->params.textclass,
par->layout).margintype == MARGIN_DYNAMIC
|| textclasslist.Style(buffer->params.textclass,
par->layout).labeltype == LABEL_SENSITIVE)
) {
/* Rebreak the paragraph */
@ -1940,7 +1950,7 @@ void LyXText::CutSelection(bool doclear)
DeleteSimpleCutBuffer();
// set the textclass
simple_cut_buffer_textclass = bparams->textclass;
simple_cut_buffer_textclass = buffer->params.textclass;
#ifdef WITH_WARNINGS
#warning Asger: Make cut more intelligent here.
@ -2201,13 +2211,13 @@ void LyXText::CutSelection(bool doclear)
endpar = sel_start_cursor.par;
cap.cutSelection(sel_start_cursor.par, &endpar,
sel_start_cursor.pos, sel_end_cursor.pos,
bparams->textclass, doclear);
buffer->params.textclass, doclear);
} else {
endpar = sel_end_cursor.par;
cap.cutSelection(sel_start_cursor.par, &endpar,
sel_start_cursor.pos, sel_end_cursor.pos,
bparams->textclass, doclear);
buffer->params.textclass, doclear);
cursor.par = sel_end_cursor.par = endpar;
cursor.pos = sel_end_cursor.pos;
}
@ -2270,7 +2280,7 @@ void LyXText::CopySelection()
DeleteSimpleCutBuffer();
// set the textclass
simple_cut_buffer_textclass = bparams->textclass;
simple_cut_buffer_textclass = buffer->params->textclass;
#ifdef FIX_DOUBLE_SPACE
// copy behind a space if there is one
@ -2386,7 +2396,7 @@ void LyXText::CopySelection()
cap.copySelection(sel_start_cursor.par, sel_end_cursor.par,
sel_start_cursor.pos, sel_end_cursor.pos,
bparams->textclass);
buffer->params.textclass);
}
#endif
@ -2540,7 +2550,7 @@ void LyXText::PasteSelection()
// make sure there is no class difference
cap.SwitchLayoutsBetweenClasses(simple_cut_buffer_textclass,
bparams->textclass,
buffer->params->textclass,
simple_cut_buffer);
// make the simple_cut_buffer exactly the same layout than
@ -2676,7 +2686,7 @@ void LyXText::PasteSelection()
LyXParagraph *actpar = cursor.par;
int endpos = cursor.pos;
cap.pasteSelection(&actpar, &endpar, endpos, bparams->textclass);
cap.pasteSelection(&actpar, &endpar, endpos, buffer->params.textclass);
RedoParagraphs(cursor, endpar);
@ -2815,7 +2825,7 @@ void LyXText::InsertStringA(string const & str)
SetCursorParUndo();
bool flag =
textclasslist.Style(bparams->textclass,
textclasslist.Style(buffer->params.textclass,
cursor.par->GetLayout()).isEnvironment();
// only to be sure, should not be neccessary
ClearSelection();
@ -3076,7 +3086,7 @@ void LyXText::CheckParagraph(LyXParagraph * par,
status = LyXText::NEED_MORE_REFRESH;
// check the special right address boxes
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
par->GetLayout()).margintype
== MARGIN_RIGHT_ADDRESS_BOX) {
tmpcursor.par = par;
@ -3250,7 +3260,7 @@ void LyXText::SetCursorIntern(LyXParagraph * par,
if (main_body > 0 && pos == main_body-1) {
x += fill_label_hfill +
lyxfont::width(textclasslist
.Style(bparams->textclass,
.Style(buffer->params.textclass,
row->par->GetLayout())
.labelsep,
GetFont(row->par, -2));
@ -3445,7 +3455,7 @@ void LyXText::DeleteEmptyParagraphMechanism(LyXCursor const & old_cursor) const
if (selection) return;
// We allow all kinds of "mumbo-jumbo" when freespacing.
if (textclasslist.Style(bparams->textclass,
if (textclasslist.Style(buffer->params.textclass,
old_cursor.par->GetLayout()).free_spacing)
return;
@ -3496,7 +3506,7 @@ void LyXText::DeleteEmptyParagraphMechanism(LyXCursor const & old_cursor) const
#endif
#if 1
// Do not delete empty paragraphs with keepempty set.
if ((textclasslist.Style(bparams->textclass,
if ((textclasslist.Style(buffer->params.textclass,
old_cursor.par->GetLayout())).keepempty)
return;