for fixes to cxx warnings

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1049 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-09-27 17:07:33 +00:00
parent e3dfa5b144
commit a659066682
8 changed files with 38 additions and 14 deletions

View File

@ -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

View 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 *);

View 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

View 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

View 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;

View 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,

View 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;

View 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;
}