+2000-03-16 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * src/support/lstrings.C (compare_no_case): some change to make it
+ compile with gcc 2.95.2 and stdlibc++-v3
+
+ * src/text2.C (MeltFootnoteEnvironment): change type o
+ first_footnote_par_is_not_empty to bool.
+
+ * src/lyxparagraph.h: make text private. Changes in other files
+ because of this.
+ (fitToSize): new function
+ (setContentsFromPar): new function
+ (clearContents): new function
+ (SetChar): new function
+
+ * src/paragraph.C (readSimpleWholeFile): deleted.
+
+ * src/lyx_cb.C (InsertAsciiFile): don't use a LyXParagraph to hold
+ the file, just use a simple string instead. Also read the file in
+ a more maintainable manner.
+
+ * src/text2.C (InsertStringA): deleted.
+ (InsertStringB): deleted.
+
2000-03-15 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/text2.C (DeleteEmptyParagraphMechanism): don't run,
src/insets/form_graphics.C
src/insets/form_url.C
src/insets/insetbib.C
+src/insets/inseteditor.C
src/insets/inseterror.C
src/insets/inseterror.h
src/insets/insetert.C
src/insets/lyxinset.h
src/intl.C
src/kbsequence.C
+src/language.C
src/LaTeX.C
src/LaTeXLog.C
src/latexoptions.C
string clb = fromClipboard(win, event);
if (!clb.empty()) {
if (!ascii_type)
- text->InsertStringA(clb.c_str());
+ text->InsertStringA(clb);
else
- text->InsertStringB(clb.c_str());
+ text->InsertStringB(clb);
update(1);
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* This file is Copyright 1997-1998
* Asger Alstrup
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* This file is Copyright 1998
* Asger Alstrup
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* This file is Copyright 1999
* Kayvan A. Sylvan
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
- * This file is Copyright 1996-1999
+ * This file is Copyright 1996-2000
* Lars Gullik Bjønnes
*
* ======================================================
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 the LyX Team.
+ * Copyright 1995-2000 the LyX Team.
*
* ====================================================== */
*
* LyX, The Document Processor
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ======================================================
*/
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
*
* LyX, The Document Processor
*
- * Copyright 1999-2000 The LyX Team
+ * Copyright 1995-2000 The LyX Team
*
* ======================================================*/
#include "PainterBase.h"
#include "LColor.h"
-using std::less;
+//using std::less;
class LyXFont;
class WorkArea;
FL_OBJECT * figinset_canvas;
+// need to make the c++ compiler fint the correct version of abs.
+// This is at least true for g++.
+using std::abs;
+
static inline
void waitForX()
{
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* This file is Copyright 1996-1999
* Lars Gullik Bjønnes
if (!return_par)
return_par = par;
else {
- par->text.resize(par->text.size());
+ par->fitToSize();
par = new LyXParagraph(par);
}
pos = 0;
if (!return_par)
return_par = par;
else {
- par->text.resize(par->text.size());
+ par->fitToSize();
par = new LyXParagraph(par);
}
footnotekind = LyXParagraph::FOOTNOTE;
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1996-1999 the LyX Team.
+ * Copyright 1996-2000 the LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 the LyX Team.
+ * Copyright 1995-2000 the LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team
+ * Copyright 1995-2000 The LyX Team
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1996-1999 the LyX Team.
+ * Copyright 1996-2000 the LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1996-1999 the LyX Team.
+ * Copyright 1996-2000 the LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1996-1999 LyX Team
+ * Copyright 1996-2000 LyX Team
*
* ====================================================== */
*
* LyX, The Document Processor
*
- * Copyright 1997-1999 LyX Team
+ * Copyright 1997-2000 LyX Team
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team
+ * Copyright 1995-2000 The LyX Team
*
* ====================================================== */
* LyX, The Document Word Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1996-1999 The LyX Team.
+ * Copyright 1996-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 the LyX Team.
+ * Copyright 1995-2000 the LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#include <config.h>
#include <fstream>
+
using std::ifstream;
#include "LString.h"
MakeDisplayPath(fname, 50));
return;
}
- LyXParagraph * tmppar = new LyXParagraph;
- tmppar->readSimpleWholeFile(ifs);
-
- // set the end of the string
-#ifdef WITH_WARNINGS
-#warning why do we do this?
-#endif
- // I don't think this is needed. Actually it might be plain wrong.
- tmppar->InsertChar(tmppar->text.size() - 1, '\0');
+ ifs.unsetf(std::ios::skipws);
+ std::istream_iterator<char> ii(ifs);
+ std::istream_iterator<char> end;
+ string tmpstr(ii, end); // yet a reason for using std::string
+ // alternate approach to get the file into a string:
+ //copy(ii, end, back_inserter(tmpstr));
// insert the string
current_view->hideCursor();
// clear the selection
current_view->beforeChange();
if (!asParagraph)
- current_view->text->InsertStringA(tmppar->text);
+ current_view->text->InsertStringA(tmpstr);
else
- current_view->text->InsertStringB(tmppar->text);
- delete tmppar;
+ current_view->text->InsertStringB(tmpstr);
current_view->update(1);
}
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 1996 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team
+ * Copyright 1995-2000 The LyX Team
*
* ====================================================== */
LyX, The Document Processor
Copyright 1995 Matthias Ettrich
- Copyright 1995-1999 The LyX Team.
+ Copyright 1995-2000 The LyX Team.
======================================================
*/
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich,
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich,
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
LyXParagraph::size_type pos =
owner->view()->text->cursor.pos;
if(pos < owner->view()->text->cursor.par->size())
- dispatch_buffer = owner->view()->text->
- cursor.par->text[pos];
+ //dispatch_buffer = owner->view()->text->
+ // cursor.par->text[pos];
+ dispatch_buffer =
+ owner->view()->text->
+ cursor.par->GetChar(pos);
else
dispatch_buffer = "EOF";
}
using std::filebuf;
#include "support/LIstream.h"
+#include "support/LOstream.h"
#include "LString.h"
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX team.
+ * Copyright 1995-2000 The LyX team.
*
* ====================================================== */
///
void read();
- ///
- void readSimpleWholeFile(istream &);
-
///
LyXParagraph * TeXOnePar(ostream &, TexRow & texrow,
ostream & foot, TexRow & foot_texrow,
/// proof environment
int GetEndLabel() const;
+private:
///
TextContainer text;
+public:
///
size_type size() const { return text.size(); }
+ ///
+ void fitToSize() {
+ text.resize(text.size());
+ }
+ void setContentsFromPar(LyXParagraph * par) {
+ text = par->text;
+ }
+ void clearContents() {
+ text.clear();
+ }
+
///
VSpace added_space_top;
char GetChar(size_type pos);
///
char GetChar(size_type pos) const;
+ /// The position must already exist.
+ void SetChar(size_type pos, char c) {
+ text[pos] = c;
+ }
+
///
void SetFont(size_type pos, LyXFont const & font);
///
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#include <fstream>
#include <iomanip>
+#include <iostream>
+
using std::ofstream;
using std::cout;
using std::ios;
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
bool SearchBackward(char const * str) const;
/// needed to insert the selection
- void InsertStringA(LyXParagraph::TextContainer const & text);
+ void InsertStringA(string const & str);
/// needed to insert the selection
- void InsertStringB(LyXParagraph::TextContainer const & text);
- /// needed to insert the selection
- void InsertStringA(char const * str);
- /// needed to insert the selection
- void InsertStringB(char const * str);
+ void InsertStringB(string const & str);
/// usefull when texing from within LyX
bool GotoNextError() const;
* information.
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ###########################################################################
*/
}
-void LyXParagraph::readSimpleWholeFile(istream & is)
-{
- is.seekg(0);
- char c = 0;
- while(!is.eof()) {
- is.get(c);
- InsertChar(text.size(), c);
- };
-}
-
-
LyXParagraph * LyXParagraph::TeXOnePar(ostream & os, TexRow & texrow,
ostream & foot, TexRow & foot_texrow,
int & foot_count)
-/** Header file generated with fdesign on Mon Apr 12 19:09:43 1999.**/
+/** Header file generated with fdesign on Mon Apr 12 19:09:43 2000.**/
#ifndef FD_form_print_h_
#define FD_form_print_h_
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
// Created by Lars Gullik Bjønnes
// Copyright 1999 Lars Gullik Bjønnes (larsbj@lyx.org)
-// Released under the Gnu General Public License
+// Released into the public domain.
// Implemented and tested on g++ 2.7.2.3
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
// -*- C++-*-
/* lyx-filetool.h : tools functions for file/path handling
this file is part of LyX, the High Level Word Processor
- Copyright 1995-1999, Matthias Ettrich and the LyX Team
+ Copyright 1995-2000, Matthias Ettrich and the LyX Team
*/
#ifndef LYX_FILETOOL_H
#include <algorithm>
-#ifdef __GLIBCPP__
-#include <ctype.h>
-#else
#include <cctype>
-#endif
#include <cstdlib>
#include "LString.h"
using std::count;
using std::transform;
+#ifndef __GLIBCPP__
+// The new glibstdc++-v3 has not worked out all the quirks regarding cctype
+// yet. So currently it failes if the to using lines below are stated.
using std::tolower;
using std::toupper;
-
+#endif
int compare_no_case(string const & s, string const & s2)
{
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
if (cursor.par->table) {
int cell = NumberOfCell(cursor.par, cursor.pos);
if (cursor.par->table->ShouldBeVeryLastCell(cell))
- SetCursor(cursor.par, cursor.par->text.size());
+ SetCursor(cursor.par, cursor.par->size());
}
/* table stuff -- end */
cursor.par->ParFromPos(cursor.pos) != par; cursor.pos++);
/* now the cursor is at the beginning of the physical par */
SetCursor(cursor.par,
- cursor.pos + cursor.par->ParFromPos(cursor.pos)->text.size());
+ cursor.pos + cursor.par->ParFromPos(cursor.pos)->size());
/* the cursor must be exactly before the footnote */
par = cursor.par->ParFromPos(cursor.pos);
// dummy-paragraph !!
// not necessar anymore with UNDO :)
for (LyXParagraph::size_type i =
- cursor.par->text.size() - 1; i >= 0; --i)
+ cursor.par->size() - 1; i >= 0; --i)
cursor.par->Erase(i);
RedoParagraph();
return;
LyXParagraph::size_type tmppos =
cursor.par->PositionInParFromPos(cursor.pos);
while (tmppos < tmppar->size()) {
- unsigned char c = tmppar->text[tmppos];
+ //unsigned char c = tmppar->text[tmppos];
+ unsigned char c = tmppar->GetChar(tmppos);
if (IsKommaChar(c) || IsLineSeparatorChar(c))
break;
if (c != LyXParagraph::META_INSET) {
}
}
- tmppar->text[tmppos] = c;
+ //tmppar->text[tmppos] = c;
+ tmppar->SetChar(tmppos, c);
++tmppos;
}
CheckParagraph(tmppar, tmppos);
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
// now the cursor is at the beginning of the physical par
SetCursor(cursor.par,
cursor.pos +
- cursor.par->ParFromPos(cursor.pos)->text.size());
+ cursor.par->ParFromPos(cursor.pos)->size());
} else {
/* we are in a footnote, so let us move at the beginning */
/* this is just faster than using just CursorLeft() */
tmppar = firsttmppar;
/* tmppar is now the paragraph right before the footnote */
- char first_footnote_par_is_not_empty = tmppar->next->text.size();
+ bool first_footnote_par_is_not_empty = tmppar->next->size();
while (tmppar->next
&& tmppar->next->footnoteflag == LyXParagraph::OPEN_FOOTNOTE) {
* (only if the previous par and the footnotepar are not empty!) */
if ((!firsttmppar->next->GetLayout() && !firsttmppar->next->table)
|| firsttmppar->HasSameLayout(firsttmppar->next)) {
- if (firsttmppar->text.size()
- && !firsttmppar->IsSeparator(firsttmppar->text.size() - 1)
+ if (firsttmppar->size()
+ && !firsttmppar->IsSeparator(firsttmppar->size() - 1)
&& first_footnote_par_is_not_empty) {
firsttmppar->next->InsertChar(0, ' ');
}
tmpi2 = sel_end_cursor.par->PositionInParFromPos(sel_end_cursor.pos);
while (tmppar2->size() > tmpi2) {
- tmppar2->Erase(tmppar2->text.size() - 1);
+ tmppar2->Erase(tmppar2->size() - 1);
}
}
}
/* table stuff -- begin */
bool table_too_small = false;
if (tmpcursor.par->table) {
- while (simple_cut_buffer->text.size()
+ while (simple_cut_buffer->size()
&& !table_too_small) {
if (simple_cut_buffer->IsNewline(0)){
while(tmpcursor.pos < tmpcursor.par->Last() && !tmpcursor.par->IsNewline(tmpcursor.pos))
// of the text to insert and we are inserting at
// the beginning of the paragraph the space should
// be removed.
- while (simple_cut_buffer->text.size()) {
+ while (simple_cut_buffer->size()) {
#ifdef FIX_DOUBLE_SPACE
// This is an attempt to fix the
// "never insert a space at the
}
-void LyXText::InsertStringA(LyXParagraph::TextContainer const & text)
-{
- char * str = new char[text.size() + 1];
- copy(text.begin(), text.end(), str);
- str[text.size()] = '\0';
- InsertStringA(str);
- delete [] str;
-}
-
-
// needed to insert the selection
-void LyXText::InsertStringA(char const * s)
+void LyXText::InsertStringA(string const & str)
{
- string str(s);
LyXParagraph * par = cursor.par;
LyXParagraph::size_type pos = cursor.pos;
LyXParagraph::size_type a = 0;
#endif
}
pos = a;
- } else if (str[i]!= 13 &&
+ } else if (str[i] != 13 &&
// Ignore unprintables
(str[i] & 127) >= ' ') {
par->InsertChar(pos, str[i]);
// no more fields to fill skip the rest
break;
} else {
- if (!par->text.size()) {
+ if (!par->size()) { // par is empty
#if 1
InsetSpecialChar * new_inset =
new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
}
-void LyXText::InsertStringB(LyXParagraph::TextContainer const & text)
-{
- char * str = new char[text.size() + 1];
- copy(text.begin(), text.end(), str);
- str[text.size()] = '\0';
- InsertStringB(str);
- delete [] str;
-}
-
-
/* turns double-CR to single CR, others where converted into one blank and 13s
* that are ignored .Double spaces are also converted into one. Spaces at
* the beginning of a paragraph are forbidden. tabs are converted into one
* space. then InsertStringA is called */
-void LyXText::InsertStringB(char const * s)
+void LyXText::InsertStringB(string const & s)
{
string str(s);
LyXParagraph * par = cursor.par;
}
++i;
}
- InsertStringA(str.c_str());
+ InsertStringA(str);
}
par = par->previous ;
if (par->IsDummy() &&
par->previous->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE)
- pos += par->text.size() + 1;
+ pos += par->size() + 1;
}
if (par->previous) {
par = par->previous;
}
- pos += par->text.size() + 1;
+ pos += par->size() + 1;
}
cursor.par = par;
GetParFromID(undo->number_of_behind_par);
LyXParagraph * tmppar;
LyXParagraph * tmppar2;
- LyXParagraph * tmppar3;
- LyXParagraph * tmppar4;
LyXParagraph * endpar;
LyXParagraph * tmppar5;
// replace the paragraphs with the undo informations
- tmppar3 = undo->par;
+ LyXParagraph * tmppar3 = undo->par;
undo->par = 0; // otherwise the undo destructor would delete the paragraph
- tmppar4 = tmppar3;
+ LyXParagraph * tmppar4 = tmppar3;
if (tmppar4){
while (tmppar4->next)
tmppar4 = tmppar4->next;
tmppar5 = tmppar5->next;
// a memory optimization for edit: Only layout information
// is stored in the undo. So restore the text informations.
- if (undo->kind == Undo::EDIT){
- tmppar2->text = tmppar->text;
- tmppar->text.clear();
+ if (undo->kind == Undo::EDIT) {
+ tmppar2->setContentsFromPar(tmppar);
+ tmppar->clearContents();
+ //tmppar2->text = tmppar->text;
+ //tmppar->text.clear();
tmppar2 = tmppar2->next;
}
if ( currentrow && currentrow->par == tmppar )
// Set the cursor for redoing
- if (before){
+ if (before) {
SetCursorIntern(before->FirstSelfrowPar(), 0);
// check wether before points to a closed float and open it if necessary
if (before && before->footnoteflag == LyXParagraph::CLOSED_FOOTNOTE
// a memory optimization: Just store the layout information
// when only edit
if (kind == Undo::EDIT){
- tmppar2->text.clear();
+ //tmppar2->text.clear();
+ tmppar2->clearContents();
}
undopar = tmppar2;
// a memory optimization: Just store the layout
// information when only edit
if (kind == Undo::EDIT){
- tmppar2->next->text.clear();
+ //tmppar2->next->text.clear();
+ tmppar2->clearContents();
}
tmppar2->next->previous = tmppar2;
tmppar2 = tmppar2->next;
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* This file is Copyright 1996-1998
* Lars Gullik Bjønnes
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */