]> git.lyx.org Git - lyx.git/commitdiff
read the Changelog, preparing for prerelease
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 19 Apr 2000 01:42:55 +0000 (01:42 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 19 Apr 2000 01:42:55 +0000 (01:42 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@680 a592a061-630c-0410-9148-cb99ea01b6c8

60 files changed:
ANNOUNCE
ChangeLog
INSTALL
NEWS
UPGRADING
src/CutAndPaste.C
src/CutAndPaste.h
src/Spacing.C
src/Spacing.h
src/buffer.C
src/insets/figinset.C
src/insets/figinset.h
src/insets/insetbib.C
src/insets/insetbib.h
src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/inseterror.C
src/insets/inseterror.h
src/insets/insetfoot.C
src/insets/insetfoot.h
src/insets/insetgraphics.C
src/insets/insetgraphics.h
src/insets/insetinclude.C
src/insets/insetinclude.h
src/insets/insetinfo.C
src/insets/insetinfo.h
src/insets/insetlabel.C
src/insets/insetlabel.h
src/insets/insetlatexaccent.C
src/insets/insetlatexaccent.h
src/insets/insetparent.C
src/insets/insetparent.h
src/insets/insetquotes.C
src/insets/insetquotes.h
src/insets/insetref.C
src/insets/insetref.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/inseturl.C
src/insets/inseturl.h
src/insets/lyxinset.h
src/lyxfunc.C
src/lyxtext.h
src/mathed/formula.C
src/mathed/formula.h
src/mathed/formulamacro.C
src/mathed/formulamacro.h
src/mathed/math_defs.h
src/mathed/math_inset.h
src/mathed/math_macro.C
src/mathed/math_macro.h
src/mathed/math_root.C
src/mathed/math_root.h
src/mathed/math_write.C
src/paragraph.C
src/screen.C
src/text.C
src/text2.C

index 6bd5d793eb799072d4e8c24ce3f7915925546458..bcd4d48a8bfb8b71b8fb6912b26abecf581d4ebd 100644 (file)
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -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,
index d5c3875f1755bf73a8f4cdd570801d0dad6529b8..fcd9f67291a41c67b658ea4ea562987102dd9059 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
        \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
diff --git a/INSTALL b/INSTALL
index 263e2b20ccfa14284b0fa67d2ad4bb1056a8139d..515c9fcc548ef6038500d21194b20d9de26a397a 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -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
diff --git a/NEWS b/NEWS
index 110454b375429775f23c605abc186f29e6c93dcf..47fd131905fb10873b67dc456a5b58032e17668e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -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?
 --------------------------------
 
index 4ef1e0ee7092659f4f8ce37630ad9c3a81332991..033d975939adf384f1ab6068734b9a263e236ad3 100644 (file)
--- a/UPGRADING
+++ b/UPGRADING
@@ -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.
index 8a8d5dad58cfddcf6d743ca0c85a5050ab4d4dee..fd308dfb43cfbdd6631f765d035ab9fa68a2e27d 100644 (file)
 
 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;
        
@@ -332,7 +346,7 @@ int CutAndPaste::nrOfParagraphs() const
        if (!buf) return 0;
 
        int n = 1;
-       LyXParagraph *tmppar = buf;
+       LyXParagraph * tmppar = buf;
        while(tmppar->next) {
                ++n;
                tmppar = tmppar->next;
@@ -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;
index edc4ae0a3680ee8f9d7c47647ee57e66f539196e..7e73e5bb67ba72a632fbb329da8be2c9554fa465 100644 (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
index 19f9d1fa65fd6ff084b859faed282a6ccc50f1e2..746ee33f43838c5d42e5b6c2ae57014935c586c8 100644 (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();
+}
index 094d7d3d1c9fd14cb2241632c2c7fce2daa7bff9..f3e27123f4a41d205057f4ecbc314bf9969cf359 100644 (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;
index cd970d7ba52a17ab649d20eb0f0ead4676195553..683b58d36164baf8b5b2d239e47274bc07861498 100644 (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) {
index e0f115debcb5c6534d2b36f54236a9661a9fbdd6..9b9d28f0dd260dc7400deb5ebe017615513865f4 100644 (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 << " ";
index f8ee925ab6a84bf2013e62d4e3ed136e00dac88d..ae004dc1de44b1ca8e849f13892b4334f9e294d4 100644 (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;
        ///
index fcc69247157dc05f35e7ed3b27c9551653122cf4..467f0bb718cc392a8727b70243cc21633ca05f33 100644 (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
index 05255d03c20cd0d27e00ca973b94fbb0627b1291..a478f646f9f0061e10f7ca4d0d7588d104786563 100644 (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);
        ///
index 7d9e7964cb0e2e57b3a794a7c25532c8bc2e38a0..38eaf42af170713adc779bc1fef1729e2a2b9b4d 100644 (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;
index 55129ea103daa81f83834d4e288bcae52698a1fa..59ee7175f89e6850c31330c91dbf88cedbb68314 100644 (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;
        ///
index 029e7408d303a7a788f6ea7dbb33431ecdc726c0..cc3acec31537fccc0e549b28857e7e488cce1d8a 100644 (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;
 }
index e6b4dfa3804f313e5ee1f7dd834006694e7d6854..6f248e122050591647a2a8f8492a31951009ede1 100644 (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;
        ///
index fd775a3badea42dbb76f335d1485814c824464cd..ed2fb66624d185d1956d5e0fe38848fd1ca7a9ef 100644 (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
index 43faa6dd4aa8db64116dc2ad35b4017fc1200b48..a08fa5a01fb325582e9233536711a394dd6e4ab4 100644 (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;
     ///
index 41965868016ac5dabd5c6bd0ff47117153b18c66..41f7bb668de7877a4d02d5a0d6ba2f68a7936788 100644 (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
index daf926c07925ccf3dee8c5794f814f0bf1469898..56ccddef932bdb46bdf9d8fb8c346f77481a170d 100644 (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;
        ///
index 28e04889dc5c5a693349163e82bd35195f007ec0..1d28e3347b4e8ab3b3389c3a5a03c663182e5127 100644 (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())
index dbe65f6f7d1cd7b6b74b63b724c5848fe02ce74c..e713fb8f02d0fa6cd8fb57d29c01e089740fe2e5 100644 (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;
        
index 1047de11a2f255332a96ec333b0f22507283fe2e..656ffee6bfaabd65a3ecc09deacd37ae175fe558 100644 (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;
 }
index a3948b003b531984b73ace2320d7e75ff76fa053..aaf064f8b95424052d197acf6381733faa473978 100644 (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;
        ///
index d48f81b59d58982c57478e3deadccd5c3e6e6841..92f871afab480232dd187174b3e5c2d08cc3779e 100644 (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;
index 1b0cbb5c35fa7e4f4c77100b8b922a19f9d33b79..df4e2b5b09b2359a913503e9dd380157b65e88bd 100644 (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;
        ///
index 5b09d9a840368df3b88e4282529386541f2f16dd..cbe3c8e60510227e40aff03f2c4fe5df4ee6c78b 100644 (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;
index 1c35b131f1b4359d6a1c74b2f9389727ddf44238..e648a6b85ff6eb9197e02337879bd02b3c030b57 100644 (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;
        ///
index 14efd2a5a6daefd724b9c73da083c2911f06230f..7ed200b7f9e1bc1f1092f1e84099b49967264a47 100644 (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);
index 43527358ca198c6e4c536c716973c206f7438ff4..293ca4df381dde907bdd0de3756afb18e1a0ffc7 100644 (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()); }
        ///
index 94e4bf94a54d2db1cd0f6adb1596964efc7858a3..ae5d82a89e9229374c80daba7318dd833d9a2c78 100644 (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();
index a5bd91ee9eea112be9f09654db42f86e29e1b16d..7c89694b2a7c74b5ba5d32731df31fffb5529b90 100644 (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;
        ///
index a45c6f743184d136cb899a837f89deedd5ee6715..bb985a9ed857cc0a88432679440a3a802eb94df3 100644 (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());
index aa0f3dda8dd518a69d9bb0536385eb2aa516b6eb..a1ea4b0db1e0b466807e6330cc9fcca5e528e8db 100644 (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;
        ///
index fa28dcc865c7fbfb9d8a67b82a468f70025d2fac..f8705ec5120ac0511c7ac66e6007d040c5ce1c50 100644 (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) {
index 400ff7ebf7162c3835d2c58b4a5f3df7af27d114..a276acd580b569b04bfeeb7eb3d16c84951b5995 100644 (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;
        ///
index 4ec94b672158065a474490472a79278b82eff34c..606c17a99a7db9304b335e70aa404ecf6e69ef07 100644 (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);
index a95523f834df8e6e08cc911853334b6da5a24f5b..f3e88c38dadfa72989d1eab7dae9067e13dfd683 100644 (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; }
     ///
index 8a99bce76364bafe7513ce035356a0207cc3f249..a8f69ee1eb121aad8479933fb8f90cd2084fe6ee 100644 (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() + ' ';
index 98733457c8f44749bc3c976b6c3ea76c1a2f9c91..b89bcb591e2b10570f2675e5043c729dc317c1cf 100644 (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;
        ///
index debef0e87c7800047fbae08f7e675415608bed34..738ad9be0446adb9b424dd4df9c088a9add07e19 100644 (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;
 
        ///
index f6c3a19ac212eff85942de09afcf1992924082a2..9a2c0783e4eaa8ea0cbdfa41ae151e5eaedf258a 100644 (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);
 
index 01967e686e8066e5e241693e49cff2a5766e2899..5d6d95db98b2de16259af61310561ea4d8c8bdcb 100644 (file)
@@ -58,7 +58,7 @@ public:
        ~LyXText();
 
        /// points to Buffer.params
-       BufferParams * bparams;
+       //BufferParams * bparams;
        /// points to Buffer
        Buffer * buffer;
        ///
index c60eacff16385912dcf492aa9210956178449eb6..a17b6db0e91593ad513bdbb84c1bba51cd2ef7e8 100644 (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());
index bc74be909cea4a006013c8ef1972588d0df4b287..312056020980944e2896b170baa785f5fbecc4bb 100644 (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;
        ///
index 2834d697992ffd33aa022918e5cba15473957212..6b8f706a8970b82d5b98cc6cd93dc8b669f439ed 100644 (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;
 }
 
index 37c95c82fdc318063ed5f9245579bc1cbb1e2030..6daeb3d9ff5b6b4487629c2001923cb1201fc214 100644 (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;
        ///
index c19dce1bb1c763be04278d6afa1a920eb2816e23..c213a4c200fdf9941524e31cb4abdfb81b65a823 100644 (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);
 
 ///
index 6f969acf76fcf649da8a5402dc6d7a3e538c7fef..23522840082098d7d2520e865070024f6fb6ce98 100644 (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 << ' ';
 }
index 9042ccea514052618b9c982061d6488da5035369..a68705933dd2997f19462f4a2e88fa6a6fa4e0f7 100644 (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 << "}";
       
index 2952cc79ccd00f7dcc350f4cefe21ac2048280e5..b0f062f7b0b7cbec9dc5b54ce81a12615de2e5ae 100644 (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; }
     ///
index 141167ef323ee7a990ac186fb611d0620622aaf2..be1853c60f9bfb74ebc6aab02451073f94c584f3 100644 (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);  
index 1a3fcee3027fdb883e3e361ca25c9e4d575848e7..286a50494abe2e57081212f4742522755933011a 100644 (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();
     ///
index e0ddcb26553262291867feea91d4ff878f35b6d9..a382f96968bcb8d8ddcc6b3e686ce107283f4a7c 100644 (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();
index ee66c6d45f59f724c031e911e93e676a0325039c..83f400f8ce8bf724d4e42e866734fa39fb898b39 100644 (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) {
index 43ea434d392b2f33c410afa30183baa050f7b215..edaa5e18c0e04c772bea1ea144c86e8b87bfec74 100644 (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,
index b584b3faf9b73770ad8253066e114361bdd9c6ab..1e2ee0614150cdaa4f39f7046513c838496b9c92 100644 (file)
@@ -565,8 +565,9 @@ void LyXText::draw(Row const * row,
 // 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; 
        
@@ -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) {
index 74175d6c514cadfd4c1c022163b923c3e1d57761..c32fd0ba453ea283629ce4e4fba566028731653e 100644 (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,8 +205,9 @@ void LyXText::SetCharFont(LyXParagraph * par,
                        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;
@@ -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, 
-                                                      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 */
@@ -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,9 +1813,11 @@ 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 */ 
                        RemoveParagraph(row);
@@ -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;