*======================================================*/
#include <config.h>
-#include <stdlib.h>
-#include <ctype.h>
+#include <cstdlib>
+#include <cctype>
#ifdef __GNUG__
#pragma implementation "table.h"
#include "layout.h"
#include "lyxparagraph.h"
#include "lyxtext.h"
-#include "textutils.h"
+#include "support/textutils.h"
#include "lyx_gui_misc.h"
#include "lyxdraw.h"
#include "gettext.h"
#include "buffer.h"
#include "lyxscreen.h"
#include "minibuffer.h"
-
-// $Id: text.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $
-
-#if !defined(lint) && !defined(WITH_WARNINGS)
-static char vcid[] = "$Id: text.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $";
-#endif /* lint */
-
+#include "debug.h"
static const int LYX_PAPER_MARGIN = 20;
c == LYX_META_WIDE_TAB ||
c == LYX_META_ALGORITHM)
{
- LString fs;
+ string fs;
switch (c) {
case LYX_META_MARGIN:
fs = "margin";
* specified row */
int LyXText::RowLast(Row *row)
{
- if (row->next == NULL)
+ if (row->next == 0)
return row->par->Last()-1;
else if (row->next->par != row->par)
return row->par->Last()-1;
c == LYX_META_WIDE_FIG ||
c == LYX_META_WIDE_TAB ||
c == LYX_META_ALGORITHM) {
- LString fs;
+ string fs;
switch (c) {
case LYX_META_MARGIN:
fs = "margin";
Row dummyrow;
layout = lyxstyle.Style(parameters->textclass, row->par->GetLayout());
- LString parindent = layout->parindent;
+ string parindent = layout->parindent;
/* table stuff -- begin*/
if (row->par->table)
- parindent.clean();
+ parindent.clear();
/* table stuff -- end*/
x = LYX_PAPER_MARGIN;
if (row->par->FirstPhysicalPar()->Previous()) {
newpar = row->par->DepthHook(row->par->GetDepth());
if (newpar && lyxstyle.Style(parameters->textclass, newpar->GetLayout())->nextnoindent)
- parindent.clean();
+ parindent.clear();
}
}
}
if (newpar && !row->par->GetLayout()) {
if (newpar->FirstPhysicalPar()->noindent)
- parindent.clean();
+ parindent.clear();
else
parindent = lyxstyle.Style(parameters->textclass,
newpar->GetLayout())->parindent;
if (!layout->leftmargin.empty()) {
x += lyxstyle.TextClass(parameters->textclass)->defaultfont.signedStringWidth(layout->leftmargin);
}
- if (!row->par->GetLabelString().empty()) {
+ if (!row->par->GetLabestring().empty()) {
x += labelfont.signedStringWidth(layout->labelindent);
- x += labelfont.stringWidth(row->par->GetLabelString());
+ x += labelfont.stringWidth(row->par->GetLabestring());
x += labelfont.stringWidth(layout->labelsep);
}
break;
&& layout->labeltype != LABEL_CENTERED_TOP_ENVIRONMENT) {
x += labelfont.signedStringWidth(layout->labelindent);
x += labelfont.stringWidth(layout->labelsep);
- x += labelfont.stringWidth(row->par->GetLabelString());
+ x += labelfont.stringWidth(row->par->GetLabestring());
}
}
break;
}
}
- //fprintf(stderr,"rightmargin: %s\n", layout->rightmargin.c_str());
- //fflush(stderr);
+ //lyxerr << "rightmargin: " << layout->rightmargin << endl;
x += (lyxstyle.TextClass(parameters->textclass)->defaultfont.signedStringWidth(layout->rightmargin) * 4
/ (row->par->GetDepth() + 4));
return x;
|| layout->labeltype == LABEL_BIBLIO
|| layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT)
&& row_ptr->par->IsFirstInSequence()
- && !row_ptr->par->GetLabelString().empty()) {
+ && !row_ptr->par->GetLabestring().empty()) {
labeladdon = int(
(labelfont.maxAscent() *
layout->spacing.getValue() *
// the table should stay with the contents
if (!cursor.pos){
cursor.par->Next()->table = cursor.par->table;
- cursor.par->table = NULL;
+ cursor.par->table = 0;
}
}
/* table stuff -- end*/
if (cursor.row->next)
BreakAgain(cursor.row->next);
- need_break_row = NULL;
+ need_break_row = 0;
}
/* table stuff -- begin*/
-void LyXText::TableFeatures(int feature, LString val)
+void LyXText::TableFeatures(int feature, string val)
{
int
actCell;
case LyXTable::DELETE_TABLE:
SetCursorIntern(cursor.par, 0);
delete cursor.par->table;
- cursor.par->table = NULL;
+ cursor.par->table = 0;
// temporary: Should put table in simple_cut_buffer (with before and after
// dummy-paragraph !!
// not necessar anymore with UNDO :)
if (row->next && row->next->par == row->par)
need_break_row = row->next;
else
- need_break_row = NULL;
+ need_break_row = 0;
current_font = rawtmpfont;
real_current_font = realtmpfont;
if (row->next && row->next->par == row->par)
need_break_row = row->next;
else
- need_break_row = NULL;
+ need_break_row = 0;
current_font = rawtmpfont;
real_current_font = realtmpfont;
/* Start the selection from here */
sel_cursor = cursor;
- LString latex;
+ string latex;
/* and find the end of the word
(optional hyphens are part of a word) */
cursor.pos++;
// Finally, we copy the word to a string and return it
- char* string = NULL;
+ char* string = 0;
if (sel_cursor.pos < cursor.pos) {
string = new char [cursor.pos - sel_cursor.pos + 2];
/* set the sel cursor */
sel_cursor = cursor;
- LString latex;
+ string latex;
/* now find the end of the word */
while (cursor.pos < cursor.par->Last()
if (row->pos >= row->par->Last()) {
/* remove it */
RemoveRow(row);
- need_break_row = NULL;
+ need_break_row = 0;
}
else {
BreakAgainOneRow(row);
if (row->next && row->next->par == row->par)
need_break_row = row->next;
else
- need_break_row = NULL;
+ need_break_row = 0;
}
/* set the dimensions of the row above */
if (row->next && row->next->par == row->par)
need_break_row = row->next;
else
- need_break_row = NULL;
+ need_break_row = 0;
} else {
/* set the dimensions of the row */
row->fill = Fill(row, paperwidth);
LyXFont font;
int maxdesc;
if (row_ptr->height <= 0) {
- fprintf(stderr, "LYX_ERROR: row.height: %d \n",
- row_ptr->height);
+ lyxerr << "LYX_ERROR: row.height: " << row_ptr->height << endl;
return;
}
left_margin = LabelEnd(row_ptr);
box_x += font.textWidth(" wide-tab ", 10);
if (row_ptr->previous &&
row_ptr->previous->par->footnoteflag != LyXParagraph::OPEN_FOOTNOTE){
- LString fs;
+ string fs;
switch (row_ptr->par->footnotekind) {
case LyXParagraph::MARGIN:
fs = " margin";
|| layout->latextype != LATEX_ENVIRONMENT
|| row_ptr->par->IsFirstInSequence())) {
font = GetFont(row_ptr->par, -2);
- if (!row_ptr->par->GetLabelString().empty()) {
+ if (!row_ptr->par->GetLabestring().empty()) {
tmpx = x;
- LString tmpstring = row_ptr->par->GetLabelString();
+ string tmpstring = row_ptr->par->GetLabestring();
if (layout->labeltype == LABEL_COUNTER_CHAPTER) {
if (parameters->secnumdepth >=0){
layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT) {
if (row_ptr->par->IsFirstInSequence()) {
font = GetFont(row_ptr->par, -2);
- if (!row_ptr->par->GetLabelString().empty()) {
- LString tmpstring = row_ptr->par->GetLabelString();
+ if (!row_ptr->par->GetLabestring().empty()) {
+ string tmpstring = row_ptr->par->GetLabestring();
maxdesc = int(font.maxDescent() * layout->spacing.getValue() * parameters->spacing.getValue()
+ (layout->labelbottomsep * DefaultHeight()));