-Public release of LyX version 1.1.2
+Public release of LyX version 1.1.5cvs
===================================
What is LyX?
- 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?
------------------
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,
+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
\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
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.
(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
+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?
--------------------------------
-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
-----------------
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
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.
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;
if (!buf) return 0;
int n = 1;
- LyXParagraph *tmppar = buf;
+ LyXParagraph * tmppar = buf;
while(tmppar->next) {
++n;
tmppar = tmppar->next;
}
-LyXTextClassList::size_type CutAndPaste::getBufferTextClass() const
-{
- return textclass;
-}
-
-
bool CutAndPaste::checkPastePossible(LyXParagraph * par, int) const
{
if (!buf) return false;
LyXTextClassList::size_type class2,
LyXParagraph * par);
///
- LyXTextClassList::size_type getBufferTextClass() const;
- ///
bool checkPastePossible(LyXParagraph *, int pos) const;
-private:
- ///
- void DeleteBuffer();
};
#endif
#ifdef HAVE_SSTREAM
#include <sstream>
using std::istringstream;
+using std::ostringstream;
#else
#include <strstream>
#endif
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();
+}
#include <iosfwd>
+#include "LString.h"
+
///
class Spacing {
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;
#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);
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
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;
}
#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) {
}
#else
strstream ss;
- inset->Latex(ss, -1);
+ inset->Latex(ss, true);
ss.seekp(0);
ss.get(c);
while (!ss) {
remove(fname1.c_str());
return;
}
- inset->Latex(fs, -1);
+ inset->Latex(fs, true);
fs.seekp(0);
fs.get(c);
while(!fs) {
int InsetFig::Latex(ostream & os,
- signed char /* fragile*/, bool /* fs*/) const
+ bool /* fragile*/, bool /* fs*/) const
{
Regenerate();
if (!cmd.empty()) os << cmd << " ";
///
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;
///
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
///
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);
///
}
-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;
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;
///
int InsetError::Latex(ostream &,
- signed char /*fragile*/, bool /*fs*/) const
+ bool /*fragile*/, bool /*fs*/) const
{
return 0;
}
///
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;
///
}
-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
///
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;
///
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
///
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;
///
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())
///
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;
int InsetInfo::Latex(ostream &,
- signed char /*fragile*/, bool /*free_spc*/) const
+ bool /*fragile*/, bool /*free_spc*/) const
{
return 0;
}
///
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;
///
int InsetLabel::Latex(ostream & os,
- signed char /*fragile*/, bool /*fs*/) const
+ bool /*fragile*/, bool /*fs*/) const
{
os << escape(getCommand());
return 0;
///
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;
///
int InsetLatexAccent::Latex(ostream & os,
- signed char /*fragile*/, bool/*fs*/) const
+ bool /*fragile*/, bool/*fs*/) const
{
os << contents;
return 0;
///
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;
///
// 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);
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()); }
///
}
-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();
///
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;
///
int InsetRef::Latex(ostream & os,
- signed char /*fragile*/, bool /*fs*/) const
+ bool /*fragile*/, bool /*fs*/) const
{
if(getOptions().empty())
os << escape(getCommand());
///
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;
///
}
-int InsetSpecialChar::Latex(ostream & os, signed char /*fragile*/,
+int InsetSpecialChar::Latex(ostream & os, bool /*fragile*/,
bool free_space) const
{
switch (kind) {
/// 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;
///
}
-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);
///
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; }
///
int InsetUrl::Latex(ostream & os,
- signed char fragile, bool /*free_spc*/) const
+ bool fragile, bool /*free_spc*/) const
{
if (!getOptions().empty())
os << getOptions() + ' ';
///
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;
///
///
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;
///
// 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();
}
// 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);
~LyXText();
/// points to Buffer.params
- BufferParams * bparams;
+ //BufferParams * bparams;
/// points to Buffer
Buffer * buffer;
///
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());
///
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;
///
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;
}
///
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;
///
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;
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();
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
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);
///
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
protected:
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
inline void Metrics();
///
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
///
void draw(Painter &, int x, int baseline);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
///
void draw(Painter &, int x, int baseline);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
protected:
///
void draw(Painter &, int, int);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
inline
-void MathFuncInset::Write(std::ostream & os, signed char /* fragile */)
+void MathFuncInset::Write(std::ostream & os, bool /* fragile */)
{
os << "\\" << name << ' ';
}
}
-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
}
-void MathMacroArgument::Write(ostream & os, signed char fragile)
+void MathMacroArgument::Write(ostream & os, bool fragile)
{
if (expnd_mode) {
MathParInset::Write(os, fragile);
}
-void MathMacroTemplate::WriteDef(ostream & os, signed char fragile)
+void MathMacroTemplate::WriteDef(ostream & os, bool fragile)
{
os << "\n\\newcommand{\\" << name << "}";
///
MathedInset * Clone();
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
bool setArgumentIdx(int);
///
///
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
///
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; }
///
}
-void MathRootInset::Write(ostream & os, signed char fragile)
+void MathRootInset::Write(ostream & os, bool fragile)
{
os << '\\' << name << '[';
uroot->Write(os, fragile);
///
void draw(Painter &, int x, int baseline);
///
- void Write(std::ostream &, signed char fragile);
+ void Write(std::ostream &, bool fragile);
///
void Metrics();
///
void
-MathSpaceInset::Write(ostream & os, signed char /* fragile */)
+MathSpaceInset::Write(ostream & os, bool /* fragile */)
{
if (space >= 0 && space < 6) {
os << '\\' << latex_mathspace[space] << ' ';
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);
}
-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;
}
-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 << '{';
}
-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;
}
-void MathBigopInset::Write(ostream & os, signed char /* fragile */)
+void MathBigopInset::Write(ostream & os, bool /* fragile */)
{
bool limp = GetLimits();
}
-void MathFracInset::Write(ostream & os, signed char fragile)
+void MathFracInset::Write(ostream & os, bool fragile)
{
os << '\\' << name << '{';
MathParInset::Write(os, fragile);
}
-void MathParInset::Write(ostream & os, signed char fragile)
+void MathParInset::Write(ostream & os, bool fragile)
{
if (!array) return;
int brace = 0;
}
-void MathMatrixInset::Write(ostream & os, signed char fragile)
+void MathMatrixInset::Write(ostream & os, bool fragile)
{
if (GetType() == LM_OT_MATRIX){
if (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();
if (!spacing.isDefault()
&& (!Previous() || !Previous()->HasSameLayout(this))) {
- os << "\\begin{spacing}{"
- << spacing.getValue() << "}\n";
+ os << spacing.writeEnvirBegin() << "\n";
texrow.newline();
}
if (!spacing.isDefault()
&& (!par || !par->HasSameLayout(this))) {
- os << "\\end{spacing}\n";
+ os << spacing.writeEnvirEnd() << "\n";
texrow.newline();
}
#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) {
}
#else
strstream ss;
- inset->Latex(ss, -1);
+ inset->Latex(ss, true);
ss.seekp(0);
ss.get(c);
while (!ss) {
fname2);
return false;
}
- inset->Latex(fs, -1);
+ inset->Latex(fs, true);
fs.seekp(0);
fs.get(c);
while (!fs) {
#include "lyxrow.h"
#include "Painter.h"
#include "WorkArea.h"
-#include "bufferparams.h"
+#include "buffer.h"
#include "font.h"
using std::max;
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,
// exactly the label-width.
int LyXText::LeftMargin(Row const * row) const
{
- LyXLayout const & layout = textclasslist.Style(bparams->textclass,
- row->par->GetLayout());
+ LyXLayout const & layout =
+ textclasslist.Style(buffer->params.textclass,
+ row->par->GetLayout());
string parindent = layout.parindent;
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) {
LyXParagraph * newpar = row->par
->DepthHook(row->par->GetDepth());
if (newpar &&
- textclasslist.Style(bparams->textclass,
+ textclasslist.Style(buffer->params.textclass,
newpar->GetLayout())
.nextnoindent)
parindent.clear();
// 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;
parindent.clear();
else
parindent = textclasslist
- .Style(bparams->textclass,
+ .Style(buffer->params.textclass,
newpar->GetLayout()).parindent;
}
if (!layout.leftmargin.empty()) {
x += lyxfont::signedWidth(layout.leftmargin,
textclasslist
- .TextClass(bparams->
+ .TextClass(buffer->params.
textclass)
.defaultfont());
}
}
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:
x += lyxfont::signedWidth(layout.leftmargin,
textclasslist
- .TextClass(bparams->textclass)
+ .TextClass(buffer->params.textclass)
.defaultfont());
x += minfill;
}
&& 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());
}
}
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) {
// 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;
}
//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;
}
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;
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) {
/* 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;
} 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);
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))
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);
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;
&& 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 */
/* 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) *
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(
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());
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 {
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;
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());
}
}
}
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 */
* 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*/
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);
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
* 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;
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));
&& (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
&& (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
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;
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);
}
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))
}
LyXLayout const & layout =
- textclasslist.Style(bparams->textclass,
+ textclasslist.Style(buffer->params.textclass,
row_ptr->par->GetLayout());
firstpar = row_ptr->par->FirstPhysicalPar();
/* 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 */
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)
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
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) {
|| 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) {
currentrow = 0;
currentrow_y = 0;
paperwidth = pw;
- bparams = &p->params;
+ //bparams = &p->params;
buffer = p;
number_of_rows = 0;
refresh_y = 0;
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:
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.
font = par->GetInset(pos)->ConvertFont(font);
}
- LyXLayout const & layout = textclasslist.Style(bparams->textclass,
- par->GetLayout());
+ LyXLayout const & layout =
+ textclasslist.Style(buffer->params.textclass,
+ par->GetLayout());
// Get concrete layout font to reduce against
LyXFont layoutfont;
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) {
{
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;
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 ==
// 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 =
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;
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;
// 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 {
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
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())
// 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
// this is only relevant for the beginning of paragraph
par = par->FirstPhysicalPar();
- LyXLayout const & layout = textclasslist.Style(bparams->textclass,
- par->GetLayout());
+ 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 */
&& !(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)) {
&& 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
*/
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
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
/* 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 */
RemoveParagraph(row);
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.
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;
}
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
cap.copySelection(sel_start_cursor.par, sel_end_cursor.par,
sel_start_cursor.pos, sel_end_cursor.pos,
- bparams->textclass);
+ buffer->params.textclass);
}
#endif
// 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
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);
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();
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;
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));
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;
#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;