2000-07-21 Lars Gullik Bjønnes <larsbj@lyx.org>
+ * src/toolbar.h: include commandtags.h instead of lyxfunc.h,
+ forward decl of LyXView.
+
+ * src/toolbar.C (toolbarItem): moved from toolbar.h
+ (toolbarItem::clean): ditto
+ (toolbarItem::~toolbarItem): ditto
+ (toolbarItem::operator): ditto
+
+ * src/text2.C (SetLayout): commetn out USE_OLD_SETUP_LAYOUT stuff
+
+ * src/paragraph.h: control the NEW_TABULAR define from here
+
+ * src/buffer.C: remove define USE_PARSE_FUNCTION, change
+ USE_TABULAR_INSETS to NEW_TABULAR
+
+ * src/ToolbarDefaults.C: add include "lyxlex.h"
+
+ * files using the old table/tabular: use NEW_TABULAR to control
+ compilation of old tabular stuff.
+
* src/paragraph.C (SimpleTeXOnePar): NEW_INSETS: move some #ifdef
to correct place.
#include "layout.h"
#include "insets/lyxinset.h"
-
// Prototypes
extern FD_form_table_options * fd_form_table_options;
extern FD_form_table_extra * fd_form_table_extra;
bool update = true;
if (!current_view->available())
update = false;
-
+
+#ifndef NEW_TABULAR
if (update && current_view->text->cursor.par()->table) {
char buf[12];
string pwidth, special;
table->RotateTable());
fl_set_focus_object(fd_form_table_options->form_table_options,
fd_form_table_options->button_table_delete);
- } else if (fd_form_table_options->form_table_options->visible) {
+ } else
+#endif
+ if (fd_form_table_options->form_table_options->visible) {
fl_set_focus_object(fd_form_table_options->form_table_options,
fd_form_table_options->button_table_delete);
fl_hide_form(fd_form_table_options->form_table_options);
void TableOptionsCB(FL_OBJECT * ob, long)
{
+#ifndef NEW_TABULAR
LyXTable * table = 0;
int s, num = 0;
string special, str;
} else
UpdateLayoutTable(true);
return;
+#endif
}
void SetPWidthCB(FL_OBJECT * ob, long)
{
+#ifndef NEW_TABULAR
fl_set_object_label(fd_form_table_options->text_warning, "");
Confirmed = false;
if (ob == fd_form_table_options->input_column_width) {
}
MenuLayoutTable(0); // update for alignment
}
+#endif
}
#include "LyXAction.h"
#include "toolbar.h"
#include "debug.h"
+#include "lyxlex.h"
using std::endl;
// if par = 0 normal behavior
// else insert behavior
// Returns false if "\the_end" is not read for formats >= 2.13. (Asger)
-#define USE_PARSE_FUNCTION 1
-//#define USE_TABULAR_INSETS 1
bool Buffer::readLyXformat2(LyXLex & lex, LyXParagraph * par)
{
string tmptok;
par->InsertChar(pos, LyXParagraph::META_NEWLINE, font);
++pos;
} else if (token == "\\LyXTable") {
-#ifdef USE_TABULAR_INSETS
+#ifdef NEW_TABULAR
Inset * inset = new InsetTabular(this);
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
char c, footnoteflag = 0, depth = 0;
string tmp;
LyXParagraph::size_type i;
- int j, h, ltype = 0, ltype_depth = 0,
- * clen = 0, actcell = 0, actpos = 0, cell = 0, cells = 0,
- currlinelen = 0;
+ int j;
+ int ltype = 0;
+ int ltype_depth = 0;
+ int * actcell = 0;
+ int actpos = 0;
+#ifndef NEW_TABULAR
+ int h;
+ int * clen = 0;
+ int cell = 0;
+ int cells = 0;
+#endif
+ int currlinelen = 0;
long fpos = 0;
bool ref_printed = false;
{
if (!current_view->available())
return;
-
+
+#ifndef NEW_TABULAR
// check for tables in tables
if (current_view->text->cursor.par()->table){
WriteAlert(_("Impossible Operation!"),
_("Sorry."));
return;
}
-
+#endif
current_view->owner()->getMiniBuffer()->Set(_("Inserting table..."));
int ysize = int(fl_get_slider_value(fd_form_table->slider_columns) + 0.5);
0);
}
#endif
-
+#ifndef NEW_TABULAR
current_view->text->cursor.par()->table =
new LyXTable(xsize, ysize);
-
+#endif
Language const * lang =
current_view->text->cursor.par()->getParLanguage(current_view->buffer()->params);
LyXFont font(LyXFont::ALL_INHERIT, lang);
current_view->owner()->getMiniBuffer()->Set(_("Inserting figure..."));
if (fl_get_button(fd_form_figure->radio_inline)
- || current_view->text->cursor.par()->table) {
+#ifndef NEW_TABULAR
+ || current_view->text->cursor.par()->table
+#endif
+ ) {
InsetFig * new_inset = new InsetFig(100, 20, buffer);
current_view->insertInset(new_inset);
current_view->owner()->getMiniBuffer()->Set(_("Figure inserted"));
case LFUN_RUNCHKTEX:
disable = lyxrc.chktex_command == "none";
break;
+#ifndef NEW_TABULAR
case LFUN_LAYOUT_TABLE:
disable = ! owner->view()->text->cursor.par()->table;
break;
+#endif
default:
break;
}
// up. (Lgb)
//#define NEW_INSETS 1
+// I dare you to try this one too. It is ortogonal with NEW_INSETS so you
+// can try both or just one of them.
+//#define NEW_TABULAR 1
+
/// A LyXParagraph holds all text, attributes and insets in a text paragraph
class LyXParagraph {
public:
///
LyXParagraph * previous;
+#ifndef NEW_TABULAR
/* table stuff -- begin*/
///
LyXTable * table;
/* table stuff -- end*/
-
+#endif
///
InsetBibKey * bibkey; // ale970302
void UnsetPExtraType(BufferParams const &);
///
bool linuxDocConvertChar(char c, string & sgml_string);
+#ifndef NEW_TABULAR
///
void DocBookContTableRows(Buffer const *,
std::ostream &, string & extra,
void SimpleDocBookOneTablePar(Buffer const *,
std::ostream &, string & extra,
int & desc_on, int depth);
+#endif
private:
///
struct InsetTable {
int & foot_count,
bool parent_is_rtl);
#endif
+#ifndef NEW_TABULAR
///
bool SimpleTeXOneTablePar(Buffer const *, BufferParams const &,
std::ostream &, TexRow & texrow);
std::ostream &, size_type i,
int current_cell_number,
int & column, TexRow & texrow);
+#endif
///
void SimpleTeXBlanks(std::ostream &, TexRow & texrow,
size_type const i,
// Table submenu
int SubEditTable = fl_newpup(FL_ObjWin(ob));
+#ifndef NEW_TABULAR
if (men->currentView()->available() &&
men->currentView()->text->cursor.par()->table &&
!tmpbuffer->isReadonly()){
// xgettext:no-c-format
fl_addtopup(SubEditTable, _("|Delete Table%x43"));
fl_setpup_shortcut(SubEditTable, 43, scex(_("EMT|Dd#d#D")));
- } else if (men->currentView()->the_locking_inset &&
+ } else
+#endif
+ if (men->currentView()->the_locking_inset &&
(men->currentView()->the_locking_inset->LyxCode() ==
Inset::TABULAR_CODE) &&
!tmpbuffer->isReadonly()) {
static_cast<InsetTabular *>
(men->currentView()->the_locking_inset);
inset->TabularFeatures(men->currentView(), choice - 32);
- } else {
+ }
+#ifndef NEW_TABULAR
+ else {
men->currentView()->text->
TableFeatures(men->currentView(), choice - 32);
men->currentView()->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
}
+#endif
}
break;
// version control sub-menu
fl_setpup_mode(LayoutMenu, 9, FL_PUP_CHECK);
if (font.latex() == LyXFont::ON)
fl_setpup_mode(LayoutMenu, 10, FL_PUP_CHECK);
-
+
// Grey out unavailable entries
+#ifndef NEW_TABULAR
if (!men->currentView()->text->cursor.par()->table)
fl_setpup_mode(LayoutMenu, 5, FL_PUP_GREY);
-
+#endif
if (tmpbuffer->isReadonly()) {
fl_setpup_mode(LayoutMenu, 1, FL_PUP_GREY);
fl_setpup_mode(LayoutMenu, 6, FL_PUP_GREY);
(*cit).inset->Validate(features);
}
+#ifndef NEW_TABULAR
if (table && table->IsLongTable())
features.longtable = true;
+#endif
if (pextra_type == PEXTRA_INDENT)
features.LyXParagraphIndent = true;
if (pextra_type == PEXTRA_FLOATFLT)
if (params.paragraph_separation == BufferParams::PARSEP_INDENT
&& pextra_type == LyXParagraph::PEXTRA_MINIPAGE)
features.NeedLyXMinipageIndent = true;
+#ifndef NEW_TABULAR
if (table && table->NeedRotating())
features.rotating = true;
+#endif
#ifndef NEW_INSETS
if (footnoteflag != NO_FOOTNOTE && footnotekind == ALGORITHM)
features.algorithm = true;
#ifndef NEW_INSETS
!IsDummy() &&
#endif
- !table){
+#ifndef NEW_TABULAR
+ !table
+#else
+ true
+#endif
+ ){
while (Last()
&& (IsNewline(0) || IsLineSeparator(0))){
Erase(0);
default:
// we don't need it for the last paragraph!!!
if (next
- && !(
#ifndef NEW_INSETS
- footnoteflag != LyXParagraph::NO_FOOTNOTE
+ && !( footnoteflag != LyXParagraph::NO_FOOTNOTE
&& footnotekind != LyXParagraph::FOOTNOTE
- && footnotekind != LyXParagraph::MARGIN &&
+ && footnotekind != LyXParagraph::MARGIN)
#endif
- (table
+#ifndef NEW_TABULAR
+ && !(table
|| (par
- && par->table)))) {
+ && par->table))
+#endif
+ ) {
// don't insert this if we would be adding it
// before or after a table in a float. This
// little trick is needed in order to allow
}
+#ifndef NEW_TABULAR
// This one spits out the text of a table paragraph
bool LyXParagraph::SimpleTeXOneTablePar(Buffer const * buf,
BufferParams const & bparams,
lyxerr[Debug::LATEX] << "SimpleTeXOneTablePar...done " << this << endl;
return return_value;
}
+#endif
+#ifndef NEW_TABULAR
// This one spits out the text off ContRows in tables
bool LyXParagraph::TeXContTableRows(Buffer const * buf,
BufferParams const & bparams,
lyxerr[Debug::LATEX] << "TeXContTableRows...done " << this << endl;
return return_value;
}
+#endif
bool LyXParagraph::linuxDocConvertChar(char c, string & sgml_string)
}
+#ifndef NEW_TABULAR
void LyXParagraph::SimpleDocBookOneTablePar(Buffer const * buffer,
ostream & os, string & extra,
int & desc_on, int depth)
lyxerr[Debug::LATEX] << "SimpleDocbookOneTablePar...done "
<< this << endl;
}
+#endif
+#ifndef NEW_TABULAR
void LyXParagraph::DocBookContTableRows(Buffer const * buffer,
ostream & os, string & extra,
int & desc_on,
}
lyxerr[Debug::LATEX] << "DocBookContTableRows...done " << this << endl;
}
+#endif
void LyXParagraph::SimpleTeXBlanks(ostream & os, TexRow & texrow,
if (par && par->depth > depth) {
if (textclasslist.Style(bparams.textclass,
par->layout).isParagraph()
+#ifndef NEW_TABULAR
&& !par->table
+#endif
// Thinko!
// How to handle this? (Lgb)
//&& !suffixIs(os, "\n\n")
#endif
else if (previous)
return previous->getParLanguage(bparams);
- else
+ //else
return bparams.language_info;
}
bool LyXParagraph::isRightToLeftPar(BufferParams const & bparams) const
{
- return lyxrc.rtl_support && !table
+ return lyxrc.rtl_support
+#ifndef NEW_TABULAR
+ && !table
+#endif
&& getParLanguage(bparams)->RightToLeft();
}
LyXParagraph::size_type end)
{
string s;
+#ifndef NEW_TABULAR
int actcell = 0;
int cell = 1;
-#ifndef NEW_TABULAR
if (table)
for (LyXParagraph::size_type i = 0; i < beg; ++i)
if (IsNewline(i)) {
ost << '\0';
#endif
s += ost.str();
- } else if (table && IsNewlineChar(c)) {
+ }
+#ifndef NEW_TABULAR
+ else if (table && IsNewlineChar(c)) {
if (cell >= table->NumberOfCellsInRow(actcell)) {
s += '\n';
cell = 1;
}
++actcell;
}
+#endif
}
return s;
LyXParagraph::size_type pos =
(is_space && lpos + 1 <= bidi_end &&
!row->par()->IsLineSeparator(lpos + 1) &&
- (!row->par()->table
- || !row->par()->IsNewline(lpos + 1)) )
+ (
+#ifndef NEW_TABULAR
+ !row->par()->table ||
+#endif
+ !row->par()->IsNewline(lpos + 1)) )
? lpos + 1 : lpos;
LyXFont font = row->par()->GetFontSettings(buf->params, pos);
bool new_rtl = font.isVisibleRightToLeft();
if (!lyxrc.rtl_support)
return false; // This is just for speedup
- if (!bidi_InRange(pos - 1) ||
- (par->table && par->IsNewline(pos-1)) )
+ if (!bidi_InRange(pos - 1)
+#ifndef NEW_TABULAR
+ || (par->table && par->IsNewline(pos-1))
+#endif
+ )
return false;
bool rtl = bidi_level(pos - 1) % 2;
bool rtl2 = rtl;
- if (pos == par->Last() ||
- (par->table && par->IsNewline(pos)))
+ if (pos == par->Last()
+#ifndef NEW_TABULAR
+ || (par->table && par->IsNewline(pos))
+#endif
+ )
rtl2 = par->isRightToLeftPar(buf->params);
else if (bidi_InRange(pos))
rtl2 = bidi_level(pos) % 2;
bool rtl = font.isVisibleRightToLeft();
bool rtl2 = rtl;
- if (pos == par->Last() ||
- (par->table && par->IsNewline(pos)))
+ if (pos == par->Last()
+#ifndef NEW_TABULAR
+ || (par->table && par->IsNewline(pos))
+#endif
+ )
rtl2 = par->isRightToLeftPar(buf->params);
else if (bidi_InRange(pos))
rtl2 = bidi_level(pos) % 2;
SetHeightOfRow(bview, cursor.row());
- while (!cursor.par()->Next()->table && cursor.par()->Next()->Last()
+ while (
+#ifndef NEW_TABULAR
+ !cursor.par()->Next()->table &&
+#endif
+ cursor.par()->Next()->Last()
&& cursor.par()->Next()->IsNewline(0))
cursor.par()->Next()->Erase(0);
} else if (sel_start_cursor.row() == row_ptr ||
sel_end_cursor.row() == row_ptr) {
float tmpx = x;
- int cell = 0;
#ifndef NEW_TABULAR
+ int cell = 0;
if (row_ptr->par()->table) {
cell = NumberOfCell(row_ptr->par(), row_ptr->pos());
tmpx += row_ptr->par()->table->GetBeginningOfTextInCell(cell);
(!rtl && vc == last + 1 && x > tmpx + 5) ))
c = last + 1;
#endif
- else if (vc == row->pos() ||
- (row->par()->table
- && vc <= last && row->par()->IsNewline(vc-1)) ) {
+ else if (vc == row->pos()
+#ifndef NEW_TABULAR
+ || (row->par()->table
+ && vc <= last && row->par()->IsNewline(vc-1))
+#endif
+ ) {
c = vis2log(vc);
if (bidi_level(c) % 2 == 1)
++c;
}
}
- if (!row->par()->table && row->pos() <= last && c > last
- && row->par()->IsNewline(last)) {
+ if (
+#ifndef NEW_TABULAR
+ !row->par()->table &&
+#endif
+ row->pos() <= last && c > last
+ && row->par()->IsNewline(last)) {
if (bidi_level(last) % 2 == 0)
tmpx -= SingleWidth(bview, row->par(), last);
else
#include "lyxrc.h"
#include "FloatList.h"
-//#define USE_OLD_CUT_AND_PASTE 1
-
using std::copy;
using std::endl;
using std::pair;
+
LyXText::LyXText(BufferView * bv)
{
bv_owner = bv;
// set layout over selection and make a total rebreak of those paragraphs
void LyXText::SetLayout(BufferView * bview, LyXTextClass::size_type layout)
{
- LyXCursor
- tmpcursor = cursor; /* store the current cursor */
-
-#ifdef USE_OLD_SET_LAYOUT
- // if there is no selection just set the layout
- // of the current paragraph */
- if (!selection) {
- sel_start_cursor = cursor; // dummy selection
- sel_end_cursor = cursor;
- }
-
- LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
- LyXParagraph * undoendpar = endpar;
-
- if (endpar && endpar->GetDepth()) {
- while (endpar && endpar->GetDepth()) {
- endpar = endpar->LastPhysicalPar()->Next();
- undoendpar = endpar;
- }
- }
- else if (endpar) {
- endpar = endpar->Next(); // because of parindents etc.
- }
-
- SetUndo(Undo::EDIT,
- sel_start_cursor.par()->ParFromPos(sel_start_cursor.pos())->previous,
- undoendpar);
-
- /* ok we have a selection. This is always between sel_start_cursor
- * and sel_end cursor */
- cursor = sel_start_cursor;
-
- LyXLayout const & lyxlayout =
- textclasslist.Style(bview->buffer()->params.textclass, layout);
-
- while (cursor.par() != sel_end_cursor.par()) {
- if (cursor.par()->footnoteflag ==
- sel_start_cursor.par()->footnoteflag) {
- cursor.par()->SetLayout(layout);
- MakeFontEntriesLayoutSpecific(cursor.par());
- LyXParagraph* fppar = cursor.par()->FirstPhysicalPar();
- fppar->added_space_top = lyxlayout.fill_top ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
- fppar->added_space_bottom = lyxlayout.fill_bottom ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
- if (lyxlayout.margintype == MARGIN_MANUAL)
- cursor.par()->SetLabelWidthString(lyxlayout.labelstring());
- if (lyxlayout.labeltype != LABEL_BIBLIO
- && fppar->bibkey) {
- delete fppar->bibkey;
- fppar->bibkey = 0;
- }
- }
- cursor.par() = cursor.par()->Next();
- }
- if (cursor.par()->footnoteflag ==
- sel_start_cursor.par()->footnoteflag) {
- cursor.par()->SetLayout(layout);
- MakeFontEntriesLayoutSpecific(cursor.par());
-#ifndef NEW_INSETS
- LyXParagraph* fppar = cursor.par()->FirstPhysicalPar();
-#else
- LyXParagraph* fppar = cursor.par();
-#endif
- fppar->added_space_top = lyxlayout.fill_top ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
- fppar->added_space_bottom = lyxlayout.fill_bottom ?
- VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
- if (lyxlayout.margintype == MARGIN_MANUAL)
- cursor.par()->SetLabelWidthString(lyxlayout.labelstring());
- if (lyxlayout.labeltype != LABEL_BIBLIO
- && fppar->bibkey) {
- delete fppar->bibkey;
- fppar->bibkey = 0;
- }
- }
-#else
+ LyXCursor tmpcursor = cursor; /* store the current cursor */
+
+// #ifdef USE_OLD_SET_LAYOUT
+// // if there is no selection just set the layout
+// // of the current paragraph */
+// if (!selection) {
+// sel_start_cursor = cursor; // dummy selection
+// sel_end_cursor = cursor;
+// }
+
+// LyXParagraph * endpar = sel_end_cursor.par()->LastPhysicalPar()->Next();
+// LyXParagraph * undoendpar = endpar;
+
+// if (endpar && endpar->GetDepth()) {
+// while (endpar && endpar->GetDepth()) {
+// endpar = endpar->LastPhysicalPar()->Next();
+// undoendpar = endpar;
+// }
+// }
+// else if (endpar) {
+// endpar = endpar->Next(); // because of parindents etc.
+// }
+
+// SetUndo(Undo::EDIT,
+// sel_start_cursor.par()->ParFromPos(sel_start_cursor.pos())->previous,
+// undoendpar);
+
+// /* ok we have a selection. This is always between sel_start_cursor
+// * and sel_end cursor */
+// cursor = sel_start_cursor;
+
+// LyXLayout const & lyxlayout =
+// textclasslist.Style(bview->buffer()->params.textclass, layout);
+
+// while (cursor.par() != sel_end_cursor.par()) {
+// if (cursor.par()->footnoteflag ==
+// sel_start_cursor.par()->footnoteflag) {
+// cursor.par()->SetLayout(layout);
+// MakeFontEntriesLayoutSpecific(cursor.par());
+// LyXParagraph* fppar = cursor.par()->FirstPhysicalPar();
+// fppar->added_space_top = lyxlayout.fill_top ?
+// VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
+// fppar->added_space_bottom = lyxlayout.fill_bottom ?
+// VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
+// if (lyxlayout.margintype == MARGIN_MANUAL)
+// cursor.par()->SetLabelWidthString(lyxlayout.labelstring());
+// if (lyxlayout.labeltype != LABEL_BIBLIO
+// && fppar->bibkey) {
+// delete fppar->bibkey;
+// fppar->bibkey = 0;
+// }
+// }
+// cursor.par() = cursor.par()->Next();
+// }
+// if (cursor.par()->footnoteflag ==
+// sel_start_cursor.par()->footnoteflag) {
+// cursor.par()->SetLayout(layout);
+// MakeFontEntriesLayoutSpecific(cursor.par());
+// #ifndef NEW_INSETS
+// LyXParagraph* fppar = cursor.par()->FirstPhysicalPar();
+// #else
+// LyXParagraph* fppar = cursor.par();
+// #endif
+// fppar->added_space_top = lyxlayout.fill_top ?
+// VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
+// fppar->added_space_bottom = lyxlayout.fill_bottom ?
+// VSpace(VSpace::VFILL) : VSpace(VSpace::NONE);
+// if (lyxlayout.margintype == MARGIN_MANUAL)
+// cursor.par()->SetLabelWidthString(lyxlayout.labelstring());
+// if (lyxlayout.labeltype != LABEL_BIBLIO
+// && fppar->bibkey) {
+// delete fppar->bibkey;
+// fppar->bibkey = 0;
+// }
+// }
+// #else
// if there is no selection just set the layout
// of the current paragraph */
if (!selection) {
LyXParagraph *
endpar = SetLayout(bview, cursor, sel_start_cursor,
sel_end_cursor, layout);
-#endif
+//#endif
RedoParagraphs(bview, sel_start_cursor, endpar);
// we have to reset the selection, because the
- // geometry could have changed */
+ // geometry could have changed
SetCursor(bview, sel_start_cursor.par(),
sel_start_cursor.pos(), false);
sel_cursor = cursor;
LyXParagraph * par = cursor.par();
LyXParagraph::size_type pos = cursor.pos();
LyXParagraph::size_type a = 0;
- int cell = 0;
LyXParagraph * endpar = cursor.par()->Next();
SetCursorParUndo(bview->buffer());
&& pos && par->GetChar(pos - 1)!= ' ') {
par->InsertChar(pos, ' ', current_font);
++pos;
-#ifndef NEW_TABLAR
+#ifndef NEW_TABULAR
} else if (par->table) {
if (str[i] == '\t') {
while((pos < par->size()) &&
(par->GetChar(pos) != LyXParagraph::META_NEWLINE))
++pos;
++pos;
- cell = NumberOfCell(par, pos);
+ int cell = NumberOfCell(par, pos);
while((pos < par->size()) &&
!(par->table->IsFirstCell(cell))) {
void LyXText::InsertStringB(BufferView * bview, string const & s)
{
string str(s);
+#ifndef NEW_TABULAR
LyXParagraph * par = cursor.par();
+#endif
string::size_type i = 1;
while (i < str.length()) {
- if (str[i] == '\t' && !par->table)
+ if (str[i] == '\t'
+#ifndef NEW_TABULAR
+ && !par->table
+#endif
+ )
str[i] = ' ';
if (str[i] == ' ' && i + 1 < str.length() && str[i + 1] == ' ')
str[i] = 13;
- if (str[i] == '\n' && i + 1 < str.length() && !par->table){
+ if (str[i] == '\n' && i + 1 < str.length()
+#ifndef NEW_TABULAR
+ && !par->table
+#endif
+ ){
if (str[i + 1] != '\n') {
if (str[i - 1] != ' ')
str[i] = ' ';
cursor_vpos = (row->par()->isRightToLeftPar(bview->buffer()->params))
? row->pos() : last + 1;
else if (pos > row->pos() &&
- (pos > last || boundary ||
- (row->par()->table && row->par()->IsNewline(pos))))
+ (pos > last || boundary
+#ifndef NEW_TABULAR
+ || (row->par()->table && row->par()->IsNewline(pos))
+#endif
+ ))
/// Place cursor after char at (logical) position pos - 1
cursor_vpos = (bidi_level(pos - 1) % 2 == 0)
? log2vis(pos - 1) + 1 : log2vis(pos - 1);
--pos;
if (pos > 0) {
- if (pos == cursor.par()->Last() ||
- (cursor.par()->table && cursor.par()->IsNewline(pos)))
+ if (pos == cursor.par()->Last()
+#ifndef NEW_TABULAR
+ || (cursor.par()->table && cursor.par()->IsNewline(pos))
+#endif
+ )
--pos;
else if (cursor.par()->IsSeparator(pos)) {
if (pos > cursor.row()->pos() &&
void LyXText::CursorRightIntern(BufferView * bview, bool internal) const
{
if (!internal && cursor.boundary() &&
- (!cursor.par()->table || !cursor.par()->IsNewline(cursor.pos())))
+ (
+#ifndef NEW_TABULAR
+ !cursor.par()->table ||
+#endif
+ !cursor.par()->IsNewline(cursor.pos())))
SetCursor(bview, cursor.par(), cursor.pos(), true, false);
else if (cursor.pos() < cursor.par()->Last()) {
SetCursor(bview, cursor.par(), cursor.pos() + 1, true, false);
extern LyXAction lyxaction;
+Toolbar::toolbarItem::toolbarItem()
+{
+ action = LFUN_NOACTION;
+ icon = 0;
+}
+
+
+void Toolbar::toolbarItem::clean()
+{
+ if (icon) {
+ fl_delete_object(icon);
+ fl_free_object(icon);
+ icon = 0;
+ }
+}
+
+
+Toolbar::toolbarItem::~toolbarItem()
+{
+ clean();
+}
+
+
+Toolbar::toolbarItem &
+Toolbar::toolbarItem::operator=(Toolbar::toolbarItem const & ti)
+{
+ // do we have to check icon and IsBitmap too?
+ action = ti.action;
+ icon = 0; // locally we need to get the icon anew
+
+ return *this;
+}
+
+
Toolbar::Toolbar(LyXView * o, int x, int y)
: owner(o), sxpos(x), sypos(y)
{
#include <vector>
#include FORMS_H_LOCATION
-#include "lyxfunc.h"
+#include "commandtags.h"
#include "combox.h"
+class LyXView;
+
/** The LyX toolbar class
This class {\em is} the LyX toolbar, and is not likely to be enhanced
further until we begin the move to Qt. We will probably have to make our
///
FL_OBJECT * icon;
///
- toolbarItem() {
- action = LFUN_NOACTION;
- icon = 0;
- }
+ toolbarItem();
///
- void clean() {
- if (icon) {
- fl_delete_object(icon);
- fl_free_object(icon);
- icon = 0;
- }
- }
+ void clean();
///
- ~toolbarItem() {
- clean();
- }
-
- toolbarItem & operator=(const toolbarItem & ti) {
- // do we have to check icon and IsBitmap too?
- action = ti.action;
- icon = 0; // locally we need to get the icon anew
-
- return *this;
- }
+ ~toolbarItem();
+ ///
+ toolbarItem & operator=(toolbarItem const & ti);
};
/// typedef to simplify things
/** more...
*/
- void reset();// {
-// toollist = 0;
-// cleaned = false;
-//
-// lightReset();
-// }
+ void reset();
/** more...
*/