2003-05-07 Lars Gullik Bjønnes <larsbj@gullik.net>
+ * texrow.[Ch]: remove dependency on Paragraph and just store a id
+ instead.
+ * paragraph_pimpl.C (simpleTeXBlanks): adjust
+ (simpleTeXSpecialChars): adjust
+ (simpleTeXSpecialChars): adjust
+ * paragraph.C (simpleTeXOnePar): adjust
+ * buffer.C (makeLaTeXFile): adjust
+
* Makefile.am (BOOST_LIBS): allow boost as system lib.
* text2.C (changeDepth): parlist cleanup
texrow.reset();
// The starting paragraph of the coming rows is the
// first paragraph of the document. (Asger)
- texrow.start(&*paragraphs.begin(), 0);
+ texrow.start(paragraphs.begin()->id(), 0);
if (!only_body && nice) {
os << "%% " << lyx_docversion << " created this file. "
Change::Type running_change = Change::UNCHANGED;
- texrow.start(this, 0);
+ texrow.start(id(), 0);
// if the paragraph is empty, the loop will not be entered at all
if (empty()) {
|| getChar(i - 1) == '!'))) {
os << '\n';
texrow.newline();
- texrow.start(owner_, i + 1);
+ texrow.start(owner_->id(), i + 1);
column = 0;
} else if (style.free_spacing) {
os << '~';
os << "\\\\\n";
}
texrow.newline();
- texrow.start(owner_, i + 1);
+ texrow.start(owner_->id(), i + 1);
column = 0;
break;
}
for (int j = 0; j < tmp; ++j) {
texrow.newline();
}
- texrow.start(owner_, i + 1);
+ texrow.start(owner_->id(), i + 1);
column = 0;
} else {
column += int(os.tellp()) - len;
#include <config.h>
-#include <algorithm>
-
#include "texrow.h"
-#include "paragraph.h"
#include "debug.h"
+#include <algorithm>
+
using std::find_if;
using std::for_each;
using std::endl;
{
rowlist.clear();
count = 0;
- lastpar = 0;
+ lastid = -1;
lastpos = -1;
}
-void TexRow::start(Paragraph * par, int pos)
+void TexRow::start(int id, int pos)
{
- lastpar = par;
+ lastid = id;
lastpos = pos;
}
void TexRow::newline()
{
- int const id = lastpar ? lastpar->id() : -1;
+ int const id = lastid;
RowList::value_type tmp(id, lastpos, ++count);
rowlist.push_back(tmp);
}
#include <list>
-class Paragraph;
/// Represents the correspondence between paragraphs and the generated LaTeX file
class TexRow {
public:
///
- TexRow() : count(0), lastpar(0), lastpos(-1) {}
+ TexRow() : count(0), lastid(-1), lastpos(-1) {}
+
+ TexRow & operator+= (TexRow const &);
/// Clears structure
void reset();
/// Define what paragraph and position the next row will represent
- void start(Paragraph * par, int pos);
+ void start(int id, int pos);
/// Insert node when line is completed
void newline();
*/
bool getIdFromRow(int row, int & id, int & pos) const;
- TexRow & operator+= (TexRow const &);
-
/// Returns the number of rows contained
int rows() const { return count; }
/// container of id/pos <=> row mapping
RowList rowlist;
/// Last paragraph
- Paragraph * lastpar;
+ int lastid;
/// Last position
int lastpos;
};