+1999-10-19 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * src/chset.C (encodeString): use a char temporary instead
+
+ * src/table.C (TexEndOfCell): added tostr around
+ column_of_cell(fcell+i)+1 and around right_column_of_cell(fcell+i)+1
+ (TexEndOfCell): ditto
+ (TexEndOfCell): ditto
+ (TexEndOfCell): ditto
+ (DocBookEndOfCell): ditto
+ (DocBookEndOfCell): ditto
+ (DocBookEndOfCell): ditto
+ (DocBookEndOfCell): ditto
+
+ * src/paragraph.C (TeXEnvironment): added tostr around foot_count -1
+
+ * src/lyxfr1.C (SearchReplaceAllCB): added tostr around replace_count
+
+ * src/lyx_cb.C (MenuRunLaTeX): added tostr around ret
+ (MenuBuildProg): added tostr around ret
+ (MenuRunChktex): added tostr around ret
+ (DocumentApplyCB): added tostr around ret
+
+ * src/chset.C (encodeString): added tostr around t->ic
+
+ * src/buffer.C (makeLaTeXFile): added tostr around secnumdepth
+ (makeLaTeXFile): added tostr around tocdepth
+ (makeLaTeXFile): added tostr around ftcound - 1
+
+ * src/insets/insetbib.C (setCounter): added tostr around counter.
+
+ * src/support/lyxstring.h: added an operator+=(int) to catch more
+ mistakes.
+
+ * src/support/lyxstring.C (lyxstring): We DON'T allow NULL pointers.
+ (lyxstring): We DON'T allow NULL pointers.
+
1999-10-19 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/mathed/math_macro.C (MathMacroArgument::Write,
if (params.secnumdepth != tclass->secnumdepth) {
LFile += "\\setcounter{secnumdepth}{";
- LFile += params.secnumdepth;
+ LFile += tostr(params.secnumdepth);
LFile += "}\n";
texrow.newline();
}
if (params.tocdepth != tclass->tocdepth) {
LFile += "\\setcounter{tocdepth}{";
- LFile += params.tocdepth;
+ LFile += tostr(params.tocdepth);
LFile += "}\n";
texrow.newline();
}
if (ftcount >= 1) {
if (ftcount > 1) {
LFile += "\\addtocounter{footnote}{-";
- LFile += ftcount - 1;
+ LFile += tostr(ftcount - 1);
LFile += '}';
}
LFile += ftnote;
}
-bool CharacterSet::encodeString(string& str)
+bool CharacterSet::encodeString(string & str)
{
Cdef *t=map_;
while(t) {
if (t->str==str) {
- str.erase();
- str += t->ic;
- //str = tostr(t->ic);
+ // Can this fail? Why is ic an unsigned char?
+ str = char(t->ic);
break;
}
t=t->next;
counter = c;
if (contents.empty())
- contents += counter;
+ contents += tostr(counter);
}
s = _("One error detected");
t = _("You should try to fix it.");
} else {
- s += ret;
+ s += tostr(ret);
s += _(" errors detected.");
t = _("You should try to fix them.");
}
s = _("One error detected");
t = _("You should try to fix it.");
} else {
- s += ret;
+ s += tostr(ret);
s += _(" errors detected.");
t = _("You should try to fix them.");
}
s = _("One warning found.");
t = _("Use 'Edit->Go to Error' to find it.");
} else {
- s += ret;
+ s += tostr(ret);
s += _(" warnings found.");
t = _("Use 'Edit->Go to Error' to find them.");
}
if (ret==1)
s= _("One paragraph couldn't be converted");
else {
- s += ret;
+ s += tostr(ret);
s += _(" paragraphs couldn't be converted");
}
WriteAlert(_("Conversion Errors!"),s,
#include "LyXView.h"
#include "lyx_gui_misc.h"
#include "minibuffer.h"
+#include "support/lstrings.h"
extern BufferView *current_view; // called too many times in this file...
extern MiniBuffer *minibuffer;
if( replace_count == 1 ) {
minibuffer->Set(_("1 string has been replaced."));
} else {
- string str;
- str += replace_count;
+ string str = tostr(replace_count);
str += _(" strings have been replaced.");
minibuffer->Set(str);
}
if (foot_count >= 1) {
if (foot_count > 1) {
file += "\\addtocounter{footnote}{-";
- file += foot_count - 1;
+ file += tostr(foot_count - 1);
file += '}';
}
file += foot;
{
Assert(s); // we don't allow null pointers
static Srep empty_rep(0, "");
- if (s && *s && n) { // s is not empty string and n > 0
+ if (*s && n) { // s is not empty string and n > 0
rep = new Srep(min(strlen(s), n), s);
} else {
++empty_rep.ref;
lyxstring::lyxstring(value_type const * s)
{
- // yes we allow them just don't initalize them
- // Assert(s); // we don't allow null pointers
+ Assert(s); // we don't allow null pointers
static Srep empty_rep(0, "");
- if (s && *s) { // s is not empty string
+ if (*s) { // s is not empty string
rep = new Srep(strlen(s), s);
} else {
++empty_rep.ref;
lyxstring & operator+(int);
///
lyxstring & operator=(int);
+ ///
+ lyxstring & operator+=(int);
/// A string representation
struct Srep {
#include "table.h"
#include "vspace.h"
#include "layout.h"
+#include "support/lstrings.h"
#ifdef __GNUG__
#pragma implementation
for (i=0; i < NumberOfCellsInRow(fcell); i++){
if (BottomLine(fcell+i)){
file += "\\cline{";
- file += column_of_cell(fcell+i)+1;
+ file += tostr(column_of_cell(fcell+i)+1);
file += '-';
- file += right_column_of_cell(fcell+i)+1;
+ file += tostr(right_column_of_cell(fcell+i)+1);
file += "} ";
tmp = 1;
}
for (i=0; i < NumberOfCellsInRow(fcell); i++){
if (TopLine(fcell+i)){
file += "\\cline{";
- file += column_of_cell(fcell+i)+1;
+ file += tostr(column_of_cell(fcell+i)+1);
file += '-';
- file += right_column_of_cell(fcell+i)+1;
+ file += tostr(right_column_of_cell(fcell+i)+1);
file += "} ";
tmp = 1;
}
for (i=0; i < NumberOfCellsInRow(fcell); i++){
if (BottomLine(fcell+i)){
file += "\\cline{";
- file += column_of_cell(fcell+i)+1;
+ file += tostr(column_of_cell(fcell+i)+1);
file += '-';
- file += right_column_of_cell(fcell+i)+1;
+ file += tostr(right_column_of_cell(fcell+i)+1);
file += "} ";
hline1 += "\\cline{";
- hline1 += column_of_cell(fcell+i)+1;
+ hline1 += tostr(column_of_cell(fcell+i)+1);
hline1 += '-';
- hline1 += right_column_of_cell(fcell+i)+1;
+ hline1 += tostr(right_column_of_cell(fcell+i)+1);
hline1 += "} ";
tmp = 1;
}
if (TopLine(fcell+i)){
if (print_hline) {
file += "\\cline{";
- file += column_of_cell(fcell+i)+1;
+ file += tostr(column_of_cell(fcell+i)+1);
file += '-';
- file += right_column_of_cell(fcell+i)+1;
+ file += tostr(right_column_of_cell(fcell+i)+1);
file += "} ";
}
hline2 += "\\cline{";
- hline2 += column_of_cell(fcell+i)+1;
+ hline2 += tostr(column_of_cell(fcell+i)+1);
hline2 += '-';
- hline2 += right_column_of_cell(fcell+i)+1;
+ hline2 += tostr(right_column_of_cell(fcell+i)+1);
hline2 += "} ";
tmp = 1;
}
}
if (nvcell < numberofcells && IsMultiColumn(nvcell)) {
file += "\\multicolumn{";
- file += cells_in_multicolumn(nvcell);
+ file += tostr(cells_in_multicolumn(nvcell));
file += "}{";
if (!cellinfo_of_cell(cell+1)->align_special.empty()) {
file += cellinfo_of_cell(cell+1)->align_special;
else
file += "<TGROUP ";
file += "COLS='";
- file += columns;
+ file += tostr(columns);
file += "' COLSEP='1' ROWSEP='1'>";
addNewlineAndDepth(file,++depth);
ret++;
file += "<COLSPEC ALIGN='";
file += getDocBookAlign(i, true);
file += "' COLNAME='col";
- file += i+1;
+ file += tostr(i+1);
file += "' COLNUM='";
- file += i+1;
+ file += tostr(i+1);
file += "' COLSEP='";
if (i == (columns-1)) {
file += '1';
file += "'";
if (IsMultiColumn(0)) {
file += " NAMEST='col1' NAMEEND='col";
- file += cells_in_multicolumn(0);
+ file += tostr(cells_in_multicolumn(0));
file += "'";
}
file += ">";
file += "' VALIGN='middle'";
if (IsMultiColumn(cell+1)) {
file += " NAMEST='col";
- file += column_of_cell(cell+1) + 1;
+ file += tostr(column_of_cell(cell+1) + 1);
file += "' NAMEEND='col";
- file += column_of_cell(cell+1) +
- cells_in_multicolumn(cell+1);
+ file += tostr(column_of_cell(cell+1) +
+ cells_in_multicolumn(cell+1));
file += "'";
}
file += ">";
file += "' VALIGN='middle'";
if (IsMultiColumn(cell+1)) {
file += " NAMEST='col";
- file += column_of_cell(cell+1) + 1;
+ file += tostr(column_of_cell(cell+1) + 1);
file += "' NAMEEND='col";
- file += column_of_cell(cell+1) +
- cells_in_multicolumn(cell+1);
+ file += tostr(column_of_cell(cell+1) +
+ cells_in_multicolumn(cell+1));
file += "'";
}
file += ">";