]> git.lyx.org Git - features.git/commitdiff
for fixes to cxx warnings
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Sep 2000 17:07:33 +0000 (17:07 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Sep 2000 17:07:33 +0000 (17:07 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1049 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/LaTeX.h
src/LaTeXFeatures.C
src/LaTeXFeatures.h
src/buffer.C
src/buffer.h
src/bufferlist.h
src/insets/insettext.C

index edb13b66ffda0ab1c7ea0c64c9346fe321ef56bb..1ac073b3023132d6db8f5f931d49ea1c92c00560 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-27  Lars Gullik Bjønnes  <larsbj@lyx.org>
+
+       * src/insets/insettext.C (Ascii): return numer of '\n' in the text
+       outputed to the ostream.
+
+       * several files: fixed types based on warnings from cxx 
+
 2000-09-26  John Levon  <moz@compsoc.man.ac.uk>
 
        * src/frontends/kde/Makefile.am: fix rule for
index e49069544228b1d79eaa9c3ff0aaa68fa16ac8d4..b57a57e6ab6c522bcf90c295cbb86dbbf1585d4a 100644 (file)
@@ -111,6 +111,9 @@ public:
           path = name of the files original path.
        */
        LaTeX(string const & cmd, string const & file, string const & path);
+
+       ///
+       virtual ~LaTeX() {}
        
        /// runs LaTeX several times
        int run(TeXErrors &, MiniBuffer *);
index 204e9a66d9cbad89a962656adb81628eb19c7b45..6e1fec3c980d347cd48c421f375d28353ac8be51 100644 (file)
@@ -25,7 +25,7 @@
 
 using std::endl;
 
-LaTeXFeatures::LaTeXFeatures(BufferParams const & p, int n)
+LaTeXFeatures::LaTeXFeatures(BufferParams const & p, LyXTextClass::size_type n)
        : layout(n, false), params(p)
 {
        // packages
index 5e6ff72c565b86a48e8ad858d4cbd22b4d16b195..91165ad7f033e9e0b6e584804dbc2d4821719718 100644 (file)
@@ -21,9 +21,9 @@
 #include <set>
 
 #include "LString.h"
+#include "layout.h"
 
 class BufferParams; 
-class LyXTextClass;
 struct Language;
 
 /** The packages and commands that a buffer needs. This struct
@@ -34,7 +34,7 @@ struct Language;
 */
 struct LaTeXFeatures {
        ///
-       LaTeXFeatures(BufferParams const &, int n) ;
+       LaTeXFeatures(BufferParams const &, LyXTextClass::size_type n) ;
        /// The packaes needed by the document
        string const getPackages();
        /// The macros definitions needed by the document
index 67d59801bccc5fa8cdad4811f645d17d7f6f074f..845b038737360bb43b787a3590d0859504f9e98c 100644 (file)
@@ -1461,18 +1461,21 @@ void Buffer::writeFileAscii(string const & fname, int linelen)
 //----------------------------------------------------------------------------
 #else
 //----------------------------------------------------------------------------
-string const Buffer::asciiParagraph(LyXParagraph const * par, int linelen) const
+string const Buffer::asciiParagraph(LyXParagraph const * par,
+                                   unsigned int linelen) const
 {
        ostringstream buffer;
        LyXFont font1, font2;
        Inset const * inset;
-       char c, footnoteflag = 0, depth = 0;
+       char c;
+       LyXParagraph::footnote_flag footnoteflag = LyXParagraph::NO_FOOTNOTE;
+       char depth = 0;
        string tmp;
        LyXParagraph::size_type i;
-       int j;
+       unsigned int j;
        int ltype = 0;
        int ltype_depth = 0;
-       int currlinelen = 0;
+       unsigned int currlinelen = 0;
        bool ref_printed = false;
 
        int noparbreak = 0;
@@ -2691,8 +2694,8 @@ void Buffer::pop_tag(ostream & os, string const & tag,
 // checks, if newcol chars should be put into this line
 // writes newline, if necessary.
 static
-void linux_doc_line_break(ostream & os, unsigned int & colcount,
-                         const unsigned int newcol)
+void linux_doc_line_break(ostream & os, string::size_type & colcount,
+                         string::size_type newcol)
 {
        colcount += newcol;
        if (colcount > lyxrc.ascii_linelen) {
@@ -2703,7 +2706,7 @@ void linux_doc_line_break(ostream & os, unsigned int & colcount,
 
 
 void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
-                                 int desc_on, int const /*depth*/)
+                                 int desc_on, int /*depth*/)
 {
        LyXFont font1;
        char c;
@@ -2721,7 +2724,7 @@ void Buffer::SimpleLinuxDocOnePar(ostream & os, LyXParagraph * par,
        int stack_num = -1;          // style stack position
        // Can this be rewritten to use a std::stack, please. (Lgb)
        char stack[5][3];            // style stack 
-        unsigned int char_line_count = 5;     // Heuristic choice ;-) 
+        string::size_type char_line_count = 5;     // Heuristic choice ;-) 
 
        if (style.labeltype != LABEL_MANUAL)
                main_body = 0;
index 53df1feade9359992004e5af90d50d4f32d10a0d..ad3249b57959c7ed310d042e87de3c2d969a62bb 100644 (file)
@@ -150,8 +150,11 @@ public:
        
        ///
        void writeFileAscii(string const & , int);
+       ///
        void writeFileAscii(std::ostream &, int);
-       string const asciiParagraph(LyXParagraph const *, int linelen) const;
+       ///
+       string const asciiParagraph(LyXParagraph const *,
+                                   unsigned int linelen) const;
        ///
        void makeLaTeXFile(string const & filename,
                           string const & original_path,
index 57c59faffb786d84838355dcb36197f17194a2b0..7a89a8a87ee6e303013b01c8934b4c0dd3250f02 100644 (file)
@@ -39,6 +39,8 @@ public:
        ///
        typedef Container::const_iterator const_iterator;
        ///
+       typedef Container::size_type size_type;
+       ///
        bool empty() const { return container.empty(); }
        ///
        void release(Buffer * buf);
@@ -57,7 +59,7 @@ public:
        ///
        Buffer * operator[](int c) { return container[c]; }
        ///
-       int size() const { return container.size(); }
+       size_type size() const { return container.size(); }
 private:
        ///
        Container container;
index a22efa54664d80ec92768762fc8338c4c8c47c4b..ec9e2ed665f7b57ea6e985924cdccbfe87a6f11e 100644 (file)
@@ -1026,11 +1026,17 @@ int InsetText::Latex(Buffer const * buf, ostream & os, bool, bool) const
 int InsetText::Ascii(Buffer const * buf, ostream & os, int linelen) const
 {
     LyXParagraph * p = par;
+    unsigned int lines = 0;
+    
     while (p) {
-       os << buf->asciiParagraph(p, linelen);
+       string const tmp = buf->asciiParagraph(p, linelen);
+       lines += countChar(tmp, '\n');
+       os << tmp;
        p = p->next;
     }
     os << "\n";
+    ++lines;
+    return lines;
 }