+2000-05-04 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * (various *.C files): add using std::foo directives to please dec
+ cxx.
+
+ * replace calls to string::clear() to string::erase() (Angus)
+
+ * src/cheaders/cmath: modified to provide std::abs.
+
2000-05-04 Juergen Vigna <jug@sad.it>
* src/insets/insettext.C: Prepared all for inserting of multiple
class Bullet {
public:
///
- Bullet(int f = -1, int c = -1, int s = -1);
+ Bullet(const int f = -1, const int c = -1, const int s = -1);
///
explicit Bullet(string const &);
#include "gettext.h"
using std::ifstream;
+using std::getline;
/*
* CLASS Chktex
#include <fstream>
using std::ifstream;
+using std::getline;
#include "ImportNoweb.h"
#include "lyxrc.h"
#include "gettext.h"
using std::ifstream;
+using std::getline;
using std::endl;
// TODO: in no particular order
#include "gettext.h"
using std::ifstream;
+using std::getline;
using std::endl;
extern BufferList bufferlist;
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;
return ost.str();
}
#endif
- break;
}
return string();
}
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();
}
FL_OBJECT * figinset_canvas;
-// need to make the c++ compiler fint the correct version of abs.
+// need to make the c++ compiler find the correct version of abs.
// This is at least true for g++.
using std::abs;
<< width << 'x' << height << endl;
//
FL_OBJECT * obj;
- const int bw = int(abs(float(fl_get_border_width())));
+ const int bw = int(std::abs(float(fl_get_border_width())));
// We really want to get rid of figinset_canvas.
::figinset_canvas = figinset_canvas = obj =
{
fl_freeze_all_forms();
- const int bw = int(abs(float(fl_get_border_width())));
+ const int bw = int(std::abs(float(fl_get_border_width())));
// a box
fl_set_object_geometry(backgroundbox, xpos, ypos, width - 15, height);
lyxvc.buffer(this);
if (read_only || (lyxrc.use_tempdir)) {
tmppath = CreateBufferTmpDir();
- } else tmppath.clear();
+ } else tmppath.erase();
}
// environment tag closing
for( ; depth > par->depth; --depth) {
sgmlCloseTag(ofs, depth, environment_stack[depth]);
- environment_stack[depth].clear();
+ environment_stack[depth].erase();
}
// write opening SGML tags
if(depth == par->depth
&& !environment_stack[depth].empty()) {
sgmlCloseTag(ofs, depth, environment_stack[depth]);
- environment_stack[depth].clear();
+ environment_stack[depth].erase();
if(depth)
--depth;
else
ofs << "</p>";
}
- environment_stack[depth].clear();
+ environment_stack[depth].erase();
sgmlOpenTag(ofs, depth, style.latexname());
break;
sgmlCloseTag(ofs, depth,
environment_stack[depth]);
- environment_stack[depth].clear();
+ environment_stack[depth].erase();
}
if (depth < par->depth) {
depth = par->depth;
- environment_stack[depth].clear();
+ environment_stack[depth].erase();
}
if (environment_stack[depth] != style.latexname()) {
if(depth == 0) {
if(inner_span) {
if(!tmp_par.empty()) {
os << tmp_par;
- tmp_par.clear();
+ tmp_par.erase();
sgmlCloseTag(os, depth + 1, inner_tag);
sgmlOpenTag(os, depth + 1, inner_tag);
}
inner_tag);
if(!extra_par.empty()) os << extra_par;
if(!tag.empty()) sgmlCloseTag(os, depth, tag);
- extra_par.clear();
+ extra_par.erase();
switch (par->footnotekind) {
case LyXParagraph::FOOTNOTE:
if ((present == TAB_LIKE) || (present == FIG_LIKE)) {
DocBookHandleCaption(os, inner_tag, depth,
desc_on, par);
- inner_tag.clear();
+ inner_tag.erase();
} else {
sgmlOpenTag(os, depth + 1, inner_tag);
}
}
sgmlCloseTag(ofs, depth + command_depth,
environment_stack[depth]);
- environment_stack[depth].clear();
- environment_inner[depth].clear();
+ environment_stack[depth].erase();
+ environment_inner[depth].erase();
}
if(depth == par->depth
sgmlCloseTag(ofs, depth + command_depth,
environment_stack[depth]);
- environment_stack[depth].clear();
- environment_inner[depth].clear();
+ environment_stack[depth].erase();
+ environment_inner[depth].erase();
}
// Write opening SGML tags.
case LATEX_ITEM_ENVIRONMENT:
if (depth < par->depth) {
depth = par->depth;
- environment_stack[depth].clear();
+ environment_stack[depth].erase();
}
if (environment_stack[depth] != style.latexname()) {
// LaTeX all paragraphs from par to endpar,
// if endpar == 0 then to the end
//
- void latexParagraphs(ostream & os, LyXParagraph *par,
+ void latexParagraphs(std::ostream & os, LyXParagraph *par,
LyXParagraph *endpar, TexRow & texrow);
///
// The -*- C++ -*- math functions header.
// This file is part of the GNU ANSI C++ Library.
+// Modified for use with LyX.
#ifndef __CMATH__
#define __CMATH__
-#ifdef __GNUG__
-#include <_G_config.h>
-#endif
-
#include <math.h>
#ifdef __GNUG__
#pragma interface "cmath"
#endif
-extern "C++" {
-#if 0
-float acos (float);
-float asin (float);
-float atan (float);
-float atan2(float, float);
-float ceil (float);
-float cos (float);
-float cosh (float);
-float exp (float);
-float fabs (float);
-float floor(float);
-float fmod (float, float);
-float frexp(float, int*);
-float modf (float, float*);
-float ldexp(float, int);
-float log (float);
-float log10(float);
-float pow (float, float);
-float pow (float, int);
-float sin (float);
-float sinh (float);
-float sqrt (float);
-float tan (float);
-float tanh (float);
-#endif
-
-inline float abs (float x) { return fabs (x); }
-#if ! _G_MATH_H_INLINES /* hpux and SCO define this in math.h */
-inline double abs (double x) { return fabs (x); }
-#endif
-
-#if 0
-double pow(double, int);
-
-long double acos (long double);
-long double asin (long double);
-long double atan (long double);
-long double atan2(long double, long double);
-long double ceil (long double);
-long double cos (long double);
-long double cosh (long double);
-long double exp (long double);
-long double fabs (long double);
-long double floor(long double);
-long double frexp(long double, int*);
-long double fmod (long double, long double);
-long double frexp(long double, int*);
-long double log (long double);
-long double log10(long double);
-long double modf (long double, long double*);
-long double pow (long double, long double);
-long double pow (long double, int);
-long double sin (long double);
-long double sinh (long double);
-long double sqrt (long double);
-long double tan (long double);
-long double tanh (long double);
-#endif
-inline long double abs (long double x) { return fabs (x); }
-
-} // extern "C++"
+namespace std {
+ inline float abs (float x) { return fabs (x); }
+ inline double abs (double x) { return fabs (x); }
+}
#endif
#include "debug.h"
using std::ifstream;
+using std::getline;
using std::pair;
using std::make_pair;
using std::endl;
bool CharacterSet::loadFile(string const & fname)
{
map_.clear();
- name_.clear();
+ name_.erase();
if (fname.empty() || fname == "ascii")
return true; // ascii 7-bit
*pTemp = pszPath;
} else {
fl_hide_object(pObject);
- (*pTemp).clear();
+ (*pTemp).erase();
}
}
Temp += pszTemp;
} else {
// Directory higher up
- Temp.clear();
+ Temp.erase();
for (int i = 0; i < iSelect; ++i) {
string piece = fl_get_browser_line(pFileDlgForm->List, i+1);
// The '+2' is here to count the '@b' (JMarc)
} else {
if (!fname.empty()) {
changedfname = true;
- fname.clear();
+ fname.erase();
}
}
subcaption = fl_get_input(form->Subcaption);
#include <fstream>
using std::ifstream;
+using std::getline;
#include <cstdlib>
#include "support/LOstream.h"
using std::ostream;
+using std::endl;
InsetFoot::InsetFoot(Buffer * bf)
: InsetCollapsable(bf)
// and current buffer's textclass (number). */
LyXTextClassList::ClassList::size_type tclass =
buffer->params.textclass;
- pair <bool, LyXTextClass::size_type> layout =
+ std::pair <bool, LyXTextClass::size_type> layout =
textclasslist.NumberOfLayout(tclass, arg);
// If the entry is obsolete, use the new one instead.
#include "debug.h"
using std::ifstream;
+using std::getline;
using std::ofstream;
using std::copy;
using std::ostream_iterator;
lyxerr[Debug::INIT]
<< "Checking whether LyX is run in place... no"
<< endl;
- build_lyxdir.clear();
+ build_lyxdir.erase();
}
bool FollowLink;
// we have not done anything wrong yet.
errorstat = false;
- dispatch_buffer.clear();
+ dispatch_buffer.erase();
// if action is a pseudo-action, we need the real action
if (lyxaction.isPseudoAction(ac)) {
if (getStatus(action) & Disabled)
goto exit_with_message;
- commandshortcut.clear();
+ commandshortcut.erase();
if (lyxrc.display_shortcuts && show_sc) {
if (action != LFUN_SELFINSERT) {
lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
<< "If no other LyX program is active, please delete"
" the pipe by hand and try again." << endl;
- pipename.clear();
+ pipename.erase();
return;
}
#ifndef __EMX__
lyxerr << "LyXComm: Pipe " << tmp << " already exists.\n"
<< "If no other LyX program is active, please delete"
" the pipe by hand and try again." << endl;
- pipename.clear();
+ pipename.erase();
return;
}
#ifndef __EMX__
{
lyxerr << "LyxComm: truncated command: "
<< lsbuf << endl;
- lsbuf.clear();
+ lsbuf.erase();
}
break; // reset connection
}
}
if (i < serv->numclients) {
serv->numclients--;
- serv->clients[i].clear();
+ serv->clients[i].erase();
lyxerr[Debug::LYXSERVER]
<< "LyXServer: Client "
<< client << " said goodbye"
par->SetType(LM_OT_MIN);
par->SetStyle(LM_ST_TEXT);
if (!label.empty() && par->GetType() != LM_OT_MPARN) {
- label.clear();
+ label.erase();
}
}
disp_flag = dspf;
if (oldf) {
--type;
if (!label.empty()) {
- label.clear();
+ label.erase();
}
bv->owner()->getMiniBuffer()->Set(_("No number"));
} else {
}
UpdateLocal(bv);
} else
- label.clear();
+ label.erase();
break;
}
using std::max;
using std::endl;
+using std::ostream;
extern short greek_kb_flag;
void MiniBuffer::ExecCommand()
{
- text.clear();
+ text.erase();
fl_set_input(the_buffer, "");
fl_set_focus_object(owner->getForm(), the_buffer);
}
{
if (!text_stored.empty()){
Set(text_stored);
- text_stored.clear();
+ text_stored.erase();
}
}
using std::endl;
using std::fstream;
using std::ios;
+using std::lower_bound;
+using std::upper_bound;
int tex_code_break_column = 72; // needs non-zero initialization. set later.
// this is a bad idea, but how can LyXParagraph find its buffer to get
noindent = false;
pextra_type = PEXTRA_NONE;
- pextra_width.clear();
- pextra_widthp.clear();
+ pextra_width.erase();
+ pextra_widthp.erase();
pextra_alignment = MINIPAGE_ALIGN_TOP;
pextra_hfill = false;
pextra_start_minipage = false;
- labelstring.clear();
- labelwidthstring.clear();
+ labelstring.erase();
+ labelwidthstring.erase();
layout = 0;
bibkey = 0;
* npar = 0;
par->layout = new_layout;
- par->labelwidthstring.clear();
+ par->labelwidthstring.erase();
par->align = LYX_ALIGN_LAYOUT;
par->added_space_top = VSpace(VSpace::NONE);
par->added_space_bottom = VSpace(VSpace::NONE);
bool retval = false;
switch (c) {
case LyXParagraph::META_HFILL:
- sgml_string.clear();
+ sgml_string.erase();
break;
case LyXParagraph::META_NEWLINE:
sgml_string = '\n';
sgml_string = ' ';
break;
case '\0': // Ignore :-)
- sgml_string.clear();
+ sgml_string.erase();
break;
default:
sgml_string = c;
return;
pextra_type = PEXTRA_NONE;
- pextra_width.clear();
- pextra_widthp.clear();
+ pextra_width.erase();
+ pextra_widthp.erase();
if (textclasslist.Style(current_view->buffer()->params.textclass,
layout).isEnvironment()) {
while (par && (par->layout == layout)
&& (par->depth == depth)) {
par->pextra_type = PEXTRA_NONE;
- par->pextra_width.clear();
- par->pextra_widthp.clear();
+ par->pextra_width.erase();
+ par->pextra_widthp.erase();
par = par->NextAfterFootnote();
if (par && (par->depth > depth))
par->UnsetPExtraType();
#include "debug.h"
#include "support/lstrings.h"
-
+using std::reverse;
using std::endl;
// Spellchecker status
if (!regexMatch(copy1, RegExp)) {
// No EndChar inside. So we are finished
result1 += CompareString + result0;
- result0.clear();
+ result0.erase();
continue;
}
if (i != string::npos)
tmp.erase(i + 1, string::npos);
else
- tmp.clear(); // only c in the whole string
+ tmp.erase(); // only c in the whole string
return tmp;
}
piece = a.substr(0, i);
tmp = a.substr(i + 1);
} else if (i == 0) {
- piece.clear();
+ piece.erase();
tmp = a.substr(i + 1);
} else {
piece = a;
piece = a.substr(0, i);
tmp = a.substr(i + 1);
} else { // delimter was not found
- piece.clear();
+ piece.erase();
}
return tmp;
}
using std::ostream;
using std::istream;
+using std::getline;
using std::max;
using std::endl;
///
cellstruct & operator=(cellstruct const &);
///
+ void setBuffer(Buffer * buf);
+ ///
int cellno;
///
int width_of_cell;
using std::ostream;
using std::istream;
+using std::getline;
using std::max;
using std::endl;
if ((pos < 0) || (ch != '='))
return false;
- ret.clear();
+ ret.erase();
pos += strlen(token)+1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
if ((pos < 0) || (ch != '='))
return false;
- ret.clear();
+ ret.erase();
pos += strlen(token)+1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
if ((pos < 0) || (ch != '='))
return false;
- ret.clear();
+ ret.erase();
pos += strlen(token)+1;
ch = str[pos];
if ((ch != '"') && (ch != '\'')) { // only read till next space
/* table stuff -- begin */
if (row->par->table)
- parindent.clear();
+ parindent.erase();
/* table stuff -- end */
int x = LYX_PAPER_MARGIN;
textclasslist.Style(buffer->params.textclass,
newpar->GetLayout())
.nextnoindent)
- parindent.clear();
+ parindent.erase();
}
}
} else {
if (newpar && !row->par->GetLayout()) {
if (newpar->FirstPhysicalPar()->noindent)
- parindent.clear();
+ parindent.erase();
else
parindent = textclasslist
.Style(buffer->params.textclass,
}
if (!par->labelstring.empty()) {
- par->labelstring.clear();
+ par->labelstring.erase();
}
if (layout.margintype == MARGIN_MANUAL) {
if (!layout.labelstring().empty())
par->labelstring = layout.labelstring();
else
- par->labelstring.clear();
+ par->labelstring.erase();
} else {
if (!layout.labelstring_appendix().empty())
par->labelstring = layout.labelstring_appendix();
else
- par->labelstring.clear();
+ par->labelstring.erase();
}
#ifdef HAVE_SSTREAM
if (res == 0) {
name_ = language;
} else
- name_.clear();
+ name_.erase();
return res;
}
KmodInfo i;
i.accent = accent;
i.allowed = lyx_accent_table[accent].native;
- i.data.clear();
+ i.data.erase();
i.exception_list = 0;
string res = trans_fsm_.currentState->deadkey(c, i);
using std::endl;
using std::ifstream;
+using std::getline;
int VCS::doVCCommand(string const & cmd, string const & path)
{