more changes read the ChangeLog

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@954 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2000-08-05 05:17:18 +00:00
parent cd694827a9
commit eeaae9c355
22 changed files with 477 additions and 379 deletions

View File

@ -1,3 +1,82 @@
2000-08-05 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/support/translator.h: move all typedefs to public section
* src/support/filetools.C (MakeLatexName): return string const
(QuoteName): ditto
(TmpFileName): ditto
(FileOpenSearch): ditto
(FileSearch): ditto
(LibFileSearch): ditto
(i18nLibFileSearch): ditto
(GetEnv): ditto
(GetEnvPath): ditto
(CreateTmpDir): ditto
(CreateBufferTmpDir): ditto
(CreateLyXTmpDir): ditto
(GetCWD): ditto
(OnlyPath): ditto
(MakeAbsPath): ditto
(AddName): ditto
(OnlyFilename): ditto
(ExpandPath): ditto
(NormalizePath): ditto
(CleanupPath): ditto
(GetFileContents): ditto
(ReplaceEnvironmentPath): ditto
(MakeRelPath): ditto
(AddPath): ditto
(ChangeExtension): ditto
(MakeDisplayPath): ditto
(do_popen): return cmdret const
(findtexfile): return string const
* src/support/DebugStream.h: add some /// to please doc++
* src/frontends/DialogBase.h (endif): add some /// to please doc++
* src/texrow.C (same_rownumber): functor to use with find_if
(getIdFromRow): rewritten to use find_if and to not update the
positions. return true if row is found
(increasePos): new method, use to update positions
* src/lyxlex_pimpl.h: make LyXLex::Pimpl noncopyable
* src/lyxlex_pimpl.C (verifyTable): new method
(pushTable): use it
(Pimpl): use it
(GetString): return string const
(pushTable): rewrite to use std::stack
(popTable): ditto
(setFile): better check
(setStream): ditto
* src/lyxlex.h: make LyXLex noncopyable
* src/lyxlex.C (text): return char const * const
(GetString): return string const
(getLongString): return string const
* src/lyx_gui_misc.C (askForText): return pair<...> const
* src/lastfiles.[Ch] (operator): return string const
* src/buffer.C (parseSingleLyXformat2Token): pass string to
istringstream not char const *.
move token.end() out of loop.
(readFile): move initializaton of token
* src/BufferView2.C (insertErrors): run texrow.increasePos if
getIdFromRow is successful.
* lib/bind/emacs.bind: don't include menus bind
* development/Code_rules/Rules: the beginnings of making this
better and covering more of the unwritten rules that we have.
* development/Code_rules/Recommendations: a couple of wording
changes.
2000-08-04 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
* src/support/strerror.c: remove C++ comment.

View File

@ -8,10 +8,10 @@ follow these rules, but they should be the goal.
- Use the same form in corresponding calls to new and delete,
i.e. write delete[] obj; if new obj[n]; was used to create
the object and write delete obj; if you wrote new obj;
Notice strings should be LString's instead of char *'s.
Notice strings should be std::string's instead of char *'s.
- Define a copy constructor and an assignment operator for all
classes with dynamically allocated memory.
- Define a default constructor, copy constructor and an assignment
operator for all classes with dynamically allocated memory.
- make destructors virtual in base classes.

View File

@ -3,7 +3,7 @@ Rules for the code in LyX
[updated from the C++STYLE distrubuted with the GNU C++ Standard]
The aim of this file is to serve as a guide for the developers, to aid us to
get clean and uniform code. Still uncomplete.
get clean and uniform code. This document is still uncomplete.
We really like to have new developers joining the LyX Project. However
since we have had problems in the past with developers leaving the
@ -12,67 +12,158 @@ of this happened before that we really became aware of these issues,
but still, we don't want it to happen again. So we have put together
some guidelines and rules for the developers.
In general, if you want to contribute to the main source, we expect at least
that you:
- write good C++ code: Readable, well commented and taking advantage of the
OO model.
- adapt the code to the structures already existing in LyX, or in case that
you have better ideas, discuss them on the developer's list before writing
the code.
- take advantage of the C++ standard library.
- we use the preincrement operator whenever possible, it has potential
of beeing faster than postincrement. (same goes for decrement)
- we try to give variables minimal scope.
General
-------
These guidelines should save us a lot of work while cleaning up the code and
help us to have quality code. LyX has been haunted by problems coming from
unfinished projects by people who have left the team. Those problems will
hopefully disappear if the code is easy to hand over to somebody else.
When you send in a patch or commit to the LyX cvs repository we expect
you to add a ChangeLog entry. The entry should have this syntax:
In general, if you want to contribute to the main source, we expect at least
that you:
- the most important rule first: kiss (keep it simple stupid), always
use a simple implementation in favour of a more complicated one.
This eases maintenence a lot.
- write good C++ code: Readable, well commented and taking advantage of the
OO model. Follow the formatting guidelines. See Formatting.
- adapt the code to the structures already existing in LyX, or in case that
you have better ideas, discuss them on the developer's list before writing
the code.
- take advantage of the C++ standard library. especially don't use
custom containers when a standard container is usable, learn to use
the algorithms and functors in the standard library.
- document all variables, methods, functions, classes etc. We are
using the source documentation program doc++, a program that handles
javadoc syntax, to document sources. See Source Documentation.
- we have certain code constructs that we try to follow. See Code
Constructs.
Submiting Code
------------------
It is implicitly understood that all patches contributed to The LyX
Project is under the Gnu General Public Lisence, it you have a problem
with that, don't contribute code.
Also please don't just pup up out of the blue with a huge patch (or
small) that changes something substantial in LyX. Always discuss your
ideas with the developers on the developers mailinglist.
When you create the patch, please use "diff -up" since we find that a
lot easier to read than the other diff formats. Also please do not
send patches that implements/fix several different things, several
patches is a much better option.
We also expect you to provide a ChangeLog entry with every patch, this
describes shortly what the patch is doing. The ChangeLog entry follows
this syntax:
1999-12-13 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/support/lyxstring.C (find): assert bug fixed.
* Pointers and references
char * p = "flop";
char & c = *p;
-NOT-
char *p = "flop"; // wrong
char &c = *p; // wrong
Some time ago we had a huge discusion on this subject and after
convincing argumentation from Asger this is what we decided. Also note
that we will have:
char const * p;
-NOT-
const char * p;
Code Constructs
---------------
We have several guidelines on code constructs, some of these exists to
make the code faster, others to make the code clearer. Yet others
exists to make us able to take advantage of the strong type checking
in C++.
- Declaration of variables should wait as long as possible. The rule
is: "Don't declare it until you need it." In C++ there are a lot of
user defined types, and these can very often be expensive to
initialize. This rule connects to the next rule too.
- Make the scope of a variable as small as possible.
- Prefere preincrement to postincrement whenever possible.
Preincrement has potential of beeing faster than postincrement. Just
thing about the obvious implementations of pre/post-increment. This
rule applies to decrement too.
++T;
--U;
-NOT-
T++; // wrong
U--; // wrong
- Try to minimize evaluation of the same code over and over. This is
aimed especially at loops.
Container::iterator end = large.end();
for (Container::iterator it = large.begin(), it != end; ++it) {
...;
}
-NOT-
for (Container::iterator it = large.begin();
it != large.end(); ++it) {
...;
}
- For functions and metods that returns a non-POD type T, return T
const instead. This gives better type checking, and will give a
compiler warning when temporaries are used wrongly.
T const add(...);
-NOT-
T add(...);
Formatting
----------
* Only one delaration on each line.
int a;
int b;
-NOT-
int a, b; // wrong
This is especially important when initialization is done at the same
time:
string a("Lars");
string b("Gullik");
-NOT-
string a("Lars"), b("Gullik"); // wrong
* Pointers and references
char * p = "flop";
char & c = *p;
-NOT-
char *p = "flop"; // wrong
char &c = *p; // wrong
Some time ago we had a huge discusion on this subject and after
convincing argumentation from Asger this is what we decided. Also note
that we will have:
char const * p;
-NOT-
const char * p; // wrong
* Operator names and parentheses
operator==(type)
-NOT-
operator == (type) // wrong
operator==(type)
-NOT-
operator == (type) // wrong
The == is part of the function name, separating it makes the
declaration look like an expression.
declaration look like an expression.
* Function names and parentheses
void mangle()
-NOT-
void mangle () // wrong
void mangle()
-NOT-
void mangle () // wrong
* Enumerators
enum {
one = 1,
two = 2,
three = 3
};
-NOT-
enum { one = 1, two = 2, three 3 };
enum {
one = 1,
two = 2,
three = 3
};
-NOT-
enum { one = 1, two = 2, three 3 }; // wrong
* Naming rules for classes
@ -87,7 +178,7 @@ declaration look like an expression.
- Long variables are named like thisLongVariableName.
New types are capitalized, so this goes for typedefs,classes,structs
and enums.
and enums.
* Formatting
@ -205,4 +296,4 @@ should also go through old code and apply this algorithm to the
existing member functions. That will help maintainability in the
future.
(I'll feel in more from Scott Meyers article when time allows.)
(I'll fill in more from Scott Meyers article when time allows.)

View File

@ -196,5 +196,5 @@
# Include menu and math bindings
\bind_file menus.bind
#\bind_file menus.bind
\bind_file math.bind

View File

@ -153,8 +153,10 @@ void BufferView::insertErrors(TeXErrors & terr)
int tmpid = -1;
int tmppos = -1;
buffer()->texrow.getIdFromRow(errorrow, tmpid, tmppos);
if (buffer()->texrow.getIdFromRow(errorrow, tmpid, tmppos)) {
buffer()->texrow.increasePos(tmpid, tmppos);
}
LyXParagraph * texrowpar = 0;
if (tmpid == -1) {

View File

@ -459,7 +459,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
//lyxerr << "float body: " << old_float << endl;
#ifdef HAVE_SSTREAM
istringstream istr(old_float.c_str());
istringstream istr(old_float);
#else
istrstream istr(old_float.c_str());
#endif
@ -850,152 +850,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
// But insets should read it, it is a part of
// the inset isn't it? Lgb.
} else if (token == "\\begin_inset") {
#if 1
readInset(lex, par, pos, font);
#else
// Should be moved out into its own function/method. (Lgb)
lex.next();
string tmptok = lex.GetString();
last_inset_read = tmptok;
// test the different insets
if (tmptok == "Quotes") {
Inset * inset = new InsetQuotes;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "External") {
Inset * inset = new InsetExternal;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "FormulaMacro") {
Inset * inset = new InsetFormulaMacro;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Formula") {
Inset * inset = new InsetFormula;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Figure") {
Inset * inset = new InsetFig(100, 100, this);
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Info") {
Inset * inset = new InsetInfo;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Include") {
InsetCommandParams p( "Include" );
Inset * inset = new InsetInclude(p, this);
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "ERT") {
Inset * inset = new InsetERT;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Tabular") {
Inset * inset = new InsetTabular(this);
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Text") {
Inset * inset = new InsetText;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Foot") {
Inset * inset = new InsetFoot;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Marginal") {
Inset * inset = new InsetMarginal;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Minipage") {
Inset * inset = new InsetMinipage;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Float") {
lex.next();
string tmptok = lex.GetString();
Inset * inset = new InsetFloat(tmptok);
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "List") {
Inset * inset = new InsetList;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Theorem") {
Inset * inset = new InsetList;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Caption") {
Inset * inset = new InsetCaption;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "Graphics") {
Inset * inset = new InsetGraphics;
inset->Read(this, lex);
par->InsertInset(pos, inset, font);
++pos;
} else if (tmptok == "LatexCommand") {
InsetCommandParams inscmd;
inscmd.Read(lex);
Inset * inset = 0;
if (inscmd.getCmdName() == "cite") {
inset = new InsetCitation(inscmd);
} else if (inscmd.getCmdName() == "bibitem") {
lex.printError("Wrong place for bibitem");
inset = new InsetBibKey(inscmd);
} else if (inscmd.getCmdName() == "BibTeX") {
inset = new InsetBibtex(inscmd, this);
} else if (inscmd.getCmdName() == "index") {
inset = new InsetIndex(inscmd);
} else if (inscmd.getCmdName() == "include") {
inset = new InsetInclude(inscmd, this);
} else if (inscmd.getCmdName() == "label") {
inset = new InsetLabel(inscmd);
} else if (inscmd.getCmdName() == "url"
|| inscmd.getCmdName() == "htmlurl") {
inset = new InsetUrl(inscmd);
} else if (inscmd.getCmdName() == "ref"
|| inscmd.getCmdName() == "pageref"
|| inscmd.getCmdName() == "vref"
|| inscmd.getCmdName() == "vpageref"
|| inscmd.getCmdName() == "prettyref") {
if (!inscmd.getOptions().empty() || !inscmd.getContents().empty()) {
inset = new InsetRef(inscmd, this);
}
} else if (inscmd.getCmdName() == "tableofcontents"
|| inscmd.getCmdName() == "listofalgorithms"
|| inscmd.getCmdName() == "listoffigures"
|| inscmd.getCmdName() == "listoftables") {
inset = new InsetTOC(inscmd);
} else if (inscmd.getCmdName() == "printindex") {
inset = new InsetPrintIndex(inscmd);
} else if (inscmd.getCmdName() == "lyxparent") {
inset = new InsetParent(inscmd, this);
}
if (inset) {
par->InsertInset(pos, inset, font);
++pos;
}
}
#endif
} else if (token == "\\SpecialChar") {
LyXLayout const & layout =
textclasslist.Style(params.textclass,
@ -1060,17 +915,18 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, LyXParagraph *& par,
par->bibkey = new InsetBibKey(p);
}
par->bibkey->Read(this, lex);
}else if (token == "\\backslash") {
} else if (token == "\\backslash") {
par->InsertChar(pos, '\\', font);
++pos;
}else if (token == "\\the_end") {
} else if (token == "\\the_end") {
the_end_read = true;
} else {
// This should be insurance for the future: (Asger)
lex.printError("Unknown token `$$Token'. "
"Inserting as text.");
for(string::const_iterator cit = token.begin();
cit != token.end(); ++cit) {
string::const_iterator cit = token.begin();
string::const_iterator end = token.end();
for(; cit != end; ++cit) {
par->InsertChar(pos, (*cit), font);
++pos;
}
@ -1182,7 +1038,8 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
++pos;
} else if (tmptok == "GRAPHICS") {
Inset * inset = new InsetGraphics;
//inset->Read(this, lex);
inset->Read(this, lex);
++pos;
par->InsertInset(pos, inset, font);
} else if (tmptok == "LatexCommand") {
InsetCommandParams inscmd;
@ -1234,11 +1091,9 @@ void Buffer::readInset(LyXLex & lex, LyXParagraph *& par,
bool Buffer::readFile(LyXLex & lex, LyXParagraph * par)
{
string token;
if (lex.IsOK()) {
lex.next();
token = lex.GetString();
string token(lex.GetString());
if (token == "\\lyxformat") { // the first token _must_ be...
lex.next();
format = lex.GetFloat();

View File

@ -34,8 +34,10 @@ using SigC::slot;
details from the core of the program.
*/
#ifdef SIGC_CXX_NAMESPACES
///
class DialogBase : public SigC::Object
#else
///
class DialogBase : public Object
#endif
{

View File

@ -94,7 +94,7 @@ void LastFiles::newFile(string const & file)
}
string LastFiles::operator[](unsigned int i) const
string const LastFiles::operator[](unsigned int i) const
{
if (i < files.size())
return files[i];

View File

@ -39,8 +39,9 @@ public:
Parameters are: name of file to read. Whether LastFiles should
check for file existance, and the number of files to remember.
*/
explicit LastFiles(string const &,
bool dostat = true, unsigned int num = 4);
explicit
LastFiles(string const &,
bool dostat = true, unsigned int num = 4);
//@}
/**@name Methods */
@ -58,7 +59,7 @@ public:
*/
void writeFile(string const &) const;
///
string operator[](unsigned int) const;
string const operator[](unsigned int) const;
///
Files::const_iterator begin() const { return files.begin(); }
///

View File

@ -401,7 +401,8 @@ int AskConfirmation(string const & s1, string const & s2, string const & s3)
// Asks for a text
pair<bool, string> askForText(string const & msg, string const & dflt)
pair<bool, string> const
askForText(string const & msg, string const & dflt)
{
fl_set_resource("flInput.cancel.label", idex(_("Cancel|^[")));
fl_set_resource("flInput.ok.label", idex(_("OK|#O")));

View File

@ -60,8 +60,9 @@ int AskConfirmation(string const & s1, string const & s2 = string(),
string const & s3 = string());
/// returns a bool: false=cancelled, true=okay. string contains returned text
std::pair<bool, string> askForText(string const & msg,
string const & dflt = string());
std::pair<bool, string> const
askForText(string const & msg,
string const & dflt = string());
/// Informs the user that changes in the coming form will be ignored
void WarnReadonly(string const & file);

View File

@ -54,7 +54,8 @@ int LyXLex::GetLineNo() const
return pimpl_->lineno;
}
char const * LyXLex::text() const
char const * const LyXLex::text() const
{
return &pimpl_->buff[0];
}
@ -130,7 +131,7 @@ float LyXLex::GetFloat() const
}
string LyXLex::GetString() const
string const LyXLex::GetString() const
{
return pimpl_->GetString();
}
@ -139,7 +140,7 @@ string LyXLex::GetString() const
// I would prefer to give a tag number instead of an explicit token
// here, but it is not possible because Buffer::readLyXformat2 uses
// explicit tokens (JMarc)
string LyXLex::getLongString(string const & endtoken)
string const LyXLex::getLongString(string const & endtoken)
{
string str, prefix;
bool firstline = true;

View File

@ -14,6 +14,7 @@
#include <iosfwd>
#include "LString.h"
#include "support/utility.hpp"
///
struct keyword_item {
@ -29,7 +30,7 @@ struct keyword_item {
texclass and others to come.
See lyxrc.C for an example of usage.
*/
class LyXLex {
class LyXLex : public noncopyable {
public:
///
LyXLex (keyword_item *, int);
@ -84,7 +85,7 @@ public:
///
float GetFloat() const;
///
string GetString() const;
string const GetString() const;
/**
* Get a long string, ended by the tag `endtag'
@ -94,7 +95,7 @@ public:
* each following line. This mechanism does not work
* perfectly if you use tabs.
*/
string getLongString(string const & endtag);
string const getLongString(string const & endtag);
///
bool EatLine();
@ -104,7 +105,7 @@ public:
int CheckToken(char const * str[], int print_error);
///
char const * text() const;
char const * const text() const;
/** Pushes a token list on a stack and replaces it with a new one.
*/

View File

@ -30,24 +30,13 @@ struct compare_tags {
LyXLex::Pimpl::Pimpl(keyword_item * tab, int num)
: is(&fb__), table(tab), no_items(num),
status(0), pushed(0), lineno(0)
status(0), lineno(0)
{
if (table && !sorted(table, table + no_items, compare_tags())) {
lyxerr << "The table passed to LyXLex is not sorted!!\n"
<< "Tell the developers to fix it!" << endl;
// We sort it anyway to avoid problems.
lyxerr << "\nUnsorted:\n";
printTable(lyxerr);
sort(table, table + no_items,
compare_tags());
lyxerr << "\nSorted:\n";
printTable(lyxerr);
}
verifyTable();
}
string LyXLex::Pimpl::GetString() const
string const LyXLex::Pimpl::GetString() const
{
return string(buff);
}
@ -72,49 +61,53 @@ void LyXLex::Pimpl::printTable(ostream & os)
}
void LyXLex::Pimpl::pushTable(keyword_item * tab, int num)
void LyXLex::Pimpl::verifyTable()
{
pushed_table * tmppu = new pushed_table;
tmppu->next = pushed;
tmppu->table_elem = table;
tmppu->table_siz = no_items;
pushed = tmppu;
table = tab;
no_items = num;
// Check if the table is sorted and if not, sort it.
if (table
&& !sorted(table, table + no_items, compare_tags())) {
lyxerr << "The table passed to LyXLex is not sorted!!\n"
lyxerr << "The table passed to LyXLex is not sorted!\n"
<< "Tell the developers to fix it!" << endl;
// We sort it anyway to avoid problems.
lyxerr << "\nUnsorted:\n";
printTable(lyxerr);
sort(table, table + no_items, compare_tags());
lyxerr << "\nSorted:\n";
printTable(lyxerr);
}
}
void LyXLex::Pimpl::pushTable(keyword_item * tab, int num)
{
pushed_table tmppu(table, no_items);
pushed.push(tmppu);
table = tab;
no_items = num;
verifyTable();
}
void LyXLex::Pimpl::popTable()
{
if (pushed == 0)
if (pushed.empty()) {
lyxerr << "LyXLex error: nothing to pop!" << endl;
return;
}
pushed_table * tmp;
tmp = pushed;
table = tmp->table_elem;
no_items = tmp->table_siz;
tmp->table_elem = 0;
pushed = tmp->next;
delete tmp;
pushed_table tmp = pushed.top();
pushed.pop();
table = tmp.table_elem;
no_items = tmp.table_siz;
}
bool LyXLex::Pimpl::setFile(string const & filename)
{
if (fb__.is_open())
if (fb__.is_open() || is.tellg() > 0)
lyxerr << "Error in LyXLex::setFile: "
"file or stream already set." << endl;
fb__.open(filename.c_str(), ios::in);
@ -127,7 +120,7 @@ bool LyXLex::Pimpl::setFile(string const & filename)
void LyXLex::Pimpl::setStream(istream & i)
{
if (fb__.is_open() || is.rdbuf()->in_avail())
if (fb__.is_open() || is.tellg() > 0)
lyxerr << "Error in LyXLex::setStream: "
"file or stream already set." << endl;
is.rdbuf(i.rdbuf());

View File

@ -4,6 +4,7 @@
#define LYXLEX_PIMPL_H
#include <fstream>
#include <stack>
#include "lyxlex.h"
@ -12,31 +13,17 @@
#endif
///
struct LyXLex::Pimpl {
struct LyXLex::Pimpl : public noncopyable {
///
enum {
///
LEX_MAX_BUFF = 2048
};
///
struct pushed_table {
///
pushed_table(){
next = 0;
table_elem = 0;
}
///
pushed_table * next;
///
keyword_item * table_elem;
///
int table_siz;
};
///
Pimpl(keyword_item * tab, int num);
///
string GetString() const;
string const GetString() const;
///
void printError(string const & message) const;
///
@ -61,7 +48,6 @@ struct LyXLex::Pimpl {
bool nextToken();
///
void pushToken(string const &);
/// fb__ is only used to open files, the stream is accessed through is
std::filebuf fb__;
/// the stream that we use.
@ -77,10 +63,26 @@ struct LyXLex::Pimpl {
///
short status;
///
pushed_table * pushed;
///
int lineno;
///
string pushTok;
private:
///
void verifyTable();
///
struct pushed_table {
///
pushed_table()
: table_elem(0), table_siz(0) {}
///
pushed_table(keyword_item * ki, int siz)
: table_elem(ki), table_siz(siz) {}
///
keyword_item * table_elem;
///
int table_siz;
};
///
std::stack<pushed_table> pushed;
};
#endif

View File

@ -731,7 +731,7 @@ void LyXParagraph::InsertInset(LyXParagraph::size_type pos,
bool LyXParagraph::InsertInsetAllowed(Inset * inset)
{
lyxerr << "LyXParagraph::InsertInsetAllowed" << endl;
//lyxerr << "LyXParagraph::InsertInsetAllowed" << endl;
if (inset_owner)
return inset_owner->InsertInsetAllowed(inset);

View File

@ -20,6 +20,7 @@
#ifdef TEST_DEBUGSTREAM
#include <string>
///
struct Debug {
///
enum type {
@ -49,9 +50,9 @@ struct Debug {
};
#endif
/** DebugStream is a ostream intended for debug output. It has also support
for a logfile. Debug output is output to cerr and if the logfile is set,
to the logfile.
/** DebugStream is a ostream intended for debug output.
It has also support for a logfile. Debug output is output to cerr
and if the logfile is set, to the logfile.
Example of Usage:
DebugStream debug;
@ -91,8 +92,10 @@ struct Debug {
// 1.0.x), which generates a compiler error when subclassing from
// std::. (JMarc)
#ifdef CXX_WORKING_NAMESPACES
///
class DebugStream : public std::ostream
#else
///
class DebugStream : public ostream
#endif
{
@ -159,8 +162,12 @@ private:
Debug::type dt;
/// The no-op stream.
std::ostream nullstream;
///
struct debugstream_internal;
///
debugstream_internal * internal;
};
#endif

View File

@ -75,7 +75,7 @@ bool IsLyXFilename(string const & filename)
// Substitutes spaces with underscores in filename (and path)
string MakeLatexName(string const & file)
string const MakeLatexName(string const & file)
{
string name = OnlyFilename(file);
string path = OnlyPath(file);
@ -96,8 +96,9 @@ string MakeLatexName(string const & file)
return AddName(path, name);
}
// Substitutes spaces with underscores in filename (and path)
string QuoteName(string const & name)
string const QuoteName(string const & name)
{
// CHECK Add proper emx support here!
#ifndef __EMX__
@ -108,15 +109,15 @@ string QuoteName(string const & name)
}
/// Returns an unique name to be used as a temporary file.
string TmpFileName(string const & dir, string const & mask)
// Returns an unique name to be used as a temporary file.
string const TmpFileName(string const & dir, string const & mask)
{// With all these temporary variables, it should be safe enough :-) (JMarc)
string tmpdir;
if (dir.empty())
tmpdir = system_tempdir;
else
tmpdir = dir;
string tmpfl = AddName(tmpdir, mask);
string tmpfl(AddName(tmpdir, mask));
// find a uniq postfix for the filename...
// using the pid, and...
@ -170,7 +171,7 @@ int IsFileWriteable (string const & path)
// -1: error- couldn't find out
int IsDirWriteable (string const & path)
{
string tmpfl = TmpFileName(path);
string tmpfl(TmpFileName(path));
if (tmpfl.empty()) {
WriteFSAlert(_("LyX Internal Error!"),
@ -189,8 +190,8 @@ int IsDirWriteable (string const & path)
// If path entry begins with $$LyX/, use system_lyxdir
// If path entry begins with $$User/, use user_lyxdir
// Example: "$$User/doc;$$LyX/doc"
string FileOpenSearch (string const & path, string const & name,
string const & ext)
string const FileOpenSearch (string const & path, string const & name,
string const & ext)
{
string real_file, path_element;
bool notfound = true;
@ -225,8 +226,8 @@ string FileOpenSearch (string const & path, string const & name,
// Returns the real name of file name in directory path, with optional
// extension ext.
string FileSearch(string const & path, string const & name,
string const & ext)
string const FileSearch(string const & path, string const & name,
string const & ext)
{
// if `name' is an absolute path, we ignore the setting of `path'
// Expand Environmentvariables in 'name'
@ -253,8 +254,8 @@ string FileSearch(string const & path, string const & name,
// 1) user_lyxdir
// 2) build_lyxdir (if not empty)
// 3) system_lyxdir
string LibFileSearch(string const & dir, string const & name,
string const & ext)
string const LibFileSearch(string const & dir, string const & name,
string const & ext)
{
string fullname = FileSearch(AddPath(user_lyxdir, dir),
name, ext);
@ -271,8 +272,9 @@ string LibFileSearch(string const & dir, string const & name,
}
string i18nLibFileSearch(string const & dir, string const & name,
string const & ext)
string const
i18nLibFileSearch(string const & dir, string const & name,
string const & ext)
{
string lang = token(string(GetEnv("LANG")), '_', 0);
@ -289,7 +291,7 @@ string i18nLibFileSearch(string const & dir, string const & name,
}
string GetEnv(string const & envname)
string const GetEnv(string const & envname)
{
// f.ex. what about error checking?
char const * const ch = getenv(envname.c_str());
@ -298,7 +300,7 @@ string GetEnv(string const & envname)
}
string GetEnvPath(string const & name)
string const GetEnvPath(string const & name)
{
#ifndef __EMX__
string pathlist = subst(GetEnv(name), ':', ';');
@ -363,15 +365,17 @@ int DeleteAllFilesInDir (string const & path)
// library. Check out http://www.boost.org/
// For directory access we will then use the directory_iterator.
// Then the code will be something like:
// directory_iterator dit(path.c_str());
// if (<some way to detect failure>) {
// directory_iterator dit(path);
// directory_iterator dend;
// if (dit == dend) {
// WriteFSAlert(_("Error! Cannot open directory:"), path);
// return -1;
// }
// for (; dit != <someend>; ++dit) {
// if ((*dit) == 2." || (*dit) == "..")
// for (; dit != dend; ++dit) {
// string filename(*dit);
// if (filename == "." || filename == "..")
// continue;
// string unlinkpath = AddName(path, temp);
// string unlinkpath(AddName(path, filename));
// if (remove(unlinkpath.c_str()))
// WriteFSAlert(_("Error! Could not remove file:"),
// unlinkpath);
@ -401,9 +405,9 @@ int DeleteAllFilesInDir (string const & path)
static
string CreateTmpDir (string const & tempdir, string const & mask)
string const CreateTmpDir (string const & tempdir, string const & mask)
{
string tmpfl = TmpFileName(tempdir, mask);
string tmpfl(TmpFileName(tempdir, mask));
if ((tmpfl.empty()) || lyx::mkdir (tmpfl.c_str(), 0777)) {
WriteFSAlert(_("Error! Couldn't create temporary directory:"),
@ -430,7 +434,7 @@ int DestroyTmpDir (string const & tmpdir, bool Allfiles)
}
string CreateBufferTmpDir (string const & pathfor)
string const CreateBufferTmpDir (string const & pathfor)
{
return CreateTmpDir(pathfor, "lyx_bufrtmp");
}
@ -442,14 +446,14 @@ int DestroyBufferTmpDir (string const & tmpdir)
}
string CreateLyXTmpDir (string const & deflt)
string const CreateLyXTmpDir (string const & deflt)
{
if ((!deflt.empty()) && (deflt != "/tmp")) {
if (lyx::mkdir(deflt.c_str(), 0777)) {
#ifdef __EMX__
Path p(user_lyxdir);
#endif
string t = CreateTmpDir (deflt.c_str(), "lyx_tmp");
string t(CreateTmpDir (deflt.c_str(), "lyx_tmp"));
return t;
} else
return deflt;
@ -457,7 +461,7 @@ string CreateLyXTmpDir (string const & deflt)
#ifdef __EMX__
Path p(user_lyxdir);
#endif
string t = CreateTmpDir ("/tmp", "lyx_tmp");
string t(CreateTmpDir ("/tmp", "lyx_tmp"));
return t;
}
}
@ -472,7 +476,7 @@ int DestroyLyXTmpDir (string const & tmpdir)
// Creates directory. Returns true if succesfull
bool createDirectory(string const & path, int permission)
{
string temp = strip(CleanupPath(path), '/');
string temp(strip(CleanupPath(path), '/'));
if (temp.empty()) {
WriteAlert(_("Internal error!"),
@ -489,7 +493,7 @@ bool createDirectory(string const & path, int permission)
// Returns current working directory
string GetCWD ()
string const GetCWD ()
{
int n = 256; // Assume path is less than 256 chars
char * err;
@ -511,7 +515,7 @@ string GetCWD ()
// Strip filename from path name
string OnlyPath(string const & Filename)
string const OnlyPath(string const & Filename)
{
// If empty filename, return empty
if (Filename.empty()) return Filename;
@ -527,7 +531,7 @@ string OnlyPath(string const & Filename)
// Convert relative path into absolute path based on a basepath.
// If relpath is absolute, just use that.
// If basepath is empty, use CWD as base.
string MakeAbsPath(string const & RelPath, string const & BasePath)
string const MakeAbsPath(string const & RelPath, string const & BasePath)
{
// checks for already absolute path
if (AbsolutePath(RelPath))
@ -537,7 +541,7 @@ string MakeAbsPath(string const & RelPath, string const & BasePath)
return RelPath;
// Copies given paths
string TempRel = CleanupPath(RelPath);
string TempRel(CleanupPath(RelPath));
string TempBase;
@ -562,7 +566,7 @@ string MakeAbsPath(string const & RelPath, string const & BasePath)
TempBase.erase(TempBase.length() - 2);
// processes relative path
string RTemp = TempRel;
string RTemp(TempRel);
string Temp;
while (!RTemp.empty()) {
@ -601,10 +605,10 @@ string MakeAbsPath(string const & RelPath, string const & BasePath)
// Correctly append filename to the pathname.
// If pathname is '.', then don't use pathname.
// Chops any path of filename.
string AddName(string const & path, string const & fname)
string const AddName(string const & path, string const & fname)
{
// Get basename
string basename = OnlyFilename(fname);
string basename(OnlyFilename(fname));
string buf;
@ -619,7 +623,7 @@ string AddName(string const & path, string const & fname)
// Strips path from filename
string OnlyFilename(string const & fname)
string const OnlyFilename(string const & fname)
{
if (fname.empty())
return fname;
@ -646,10 +650,10 @@ bool AbsolutePath(string const & path)
// Create absolute path. If impossible, don't do anything
// Supports ./ and ~/. Later we can add support for ~logname/. (Asger)
string ExpandPath(string const & path)
string const ExpandPath(string const & path)
{
// checks for already absolute path
string RTemp = ReplaceEnvironmentPath(path);
string RTemp(ReplaceEnvironmentPath(path));
if (AbsolutePath(RTemp))
return RTemp;
@ -657,7 +661,7 @@ string ExpandPath(string const & path)
string copy(RTemp);
// Split by next /
RTemp= split(RTemp, Temp, '/');
RTemp = split(RTemp, Temp, '/');
if (Temp == ".") {
return GetCWD() + '/' + RTemp;
@ -674,7 +678,7 @@ string ExpandPath(string const & path)
// Normalize a path
// Constracts path/../path
// Can't handle "../../" or "/../" (Asger)
string NormalizePath(string const & path)
string const NormalizePath(string const & path)
{
string TempBase;
string RTemp;
@ -710,7 +714,8 @@ string NormalizePath(string const & path)
return TempBase;
}
string CleanupPath(string const & path)
string const CleanupPath(string const & path)
{
#ifdef __EMX__ /* SMiyata: This should fix searchpath bug. */
string temppath = subst(path, '\\', '/');
@ -721,7 +726,9 @@ string CleanupPath(string const & path)
#endif
}
string GetFileContents(string const & fname) {
string const GetFileContents(string const & fname)
{
FileInfo finfo(fname);
if (finfo.exist()) {
ifstream ifs(fname.c_str());
@ -757,7 +764,7 @@ string GetFileContents(string const & fname) {
// variable := '$' '{' [A-Za-z_]{[A-Za-z_0-9]*} '}'
//
string ReplaceEnvironmentPath(string const & path)
string const ReplaceEnvironmentPath(string const & path)
{
//
// CompareChar: Environmentvariables starts with this character
@ -828,7 +835,7 @@ string ReplaceEnvironmentPath(string const & path)
continue;
}
string env = GetEnv(res1_contents+1);
string env(GetEnv(res1_contents + 1));
if (!env.empty()) {
// Congratulations. Environmentvariable found
result1 += env;
@ -844,7 +851,7 @@ string ReplaceEnvironmentPath(string const & path)
// Make relative path out of two absolute paths
string MakeRelPath(string const & abspath0, string const & basepath0)
string const MakeRelPath(string const & abspath0, string const & basepath0)
// Makes relative path out of absolute path. If it is deeper than basepath,
// it's easy. If basepath and abspath share something (they are all deeper
// than some directory), it'll be rendered using ..'s. If they are completely
@ -856,8 +863,8 @@ string MakeRelPath(string const & abspath0, string const & basepath0)
if (abspath.empty())
return "<unknown_path>";
const int abslen = abspath.length();
const int baselen = basepath.length();
int const abslen = abspath.length();
int const baselen = basepath.length();
// Find first different character
int i = 0;
@ -904,7 +911,7 @@ string MakeRelPath(string const & abspath0, string const & basepath0)
// Append sub-directory(ies) to a path in an intelligent way
string AddPath(string const & path, string const & path_2)
string const AddPath(string const & path, string const & path_2)
{
string buf;
string path2 = CleanupPath(path_2);
@ -932,7 +939,8 @@ string AddPath(string const & path, string const & path_2)
Strips path off if no_path == true.
If no extension on oldname, just appends.
*/
string ChangeExtension(string const & oldname, string const & extension)
string const
ChangeExtension(string const & oldname, string const & extension)
{
string::size_type last_slash = oldname.rfind('/');
string::size_type last_dot = oldname.rfind('.');
@ -951,12 +959,13 @@ string ChangeExtension(string const & oldname, string const & extension)
// Creates a nice compact path for displaying
string MakeDisplayPath (string const & path, unsigned int threshold)
string const
MakeDisplayPath (string const & path, unsigned int threshold)
{
const int l1 = path.length();
int const l1 = path.length();
// First, we try a relative path compared to home
string home = GetEnvPath("HOME");
string const home(GetEnvPath("HOME"));
string relhome = MakeRelPath(path, home);
unsigned int l2 = relhome.length();
@ -1015,7 +1024,7 @@ bool LyXReadLink(string const & File, string & Link)
typedef pair<int, string> cmdret;
static
cmdret do_popen(string const & cmd)
cmdret const do_popen(string const & cmd)
{
// One question is if we should use popen or
// create our own popen based on fork, exec, pipe
@ -1034,7 +1043,8 @@ cmdret do_popen(string const & cmd)
}
string findtexfile(string const & fil, string const & /*format*/)
string const
findtexfile(string const & fil, string const & /*format*/)
{
/* There is no problem to extend this function too use other
methods to look for files. It could be setup to look
@ -1070,9 +1080,9 @@ string findtexfile(string const & fil, string const & /*format*/)
// tfm - TFMFONTS, TEXFONTS
// This means that to use kpsewhich in the best possible way we
// should help it by setting additional path in the approp. envir.var.
string kpsecmd = "kpsewhich " + fil;
string const kpsecmd = "kpsewhich " + fil;
cmdret c = do_popen(kpsecmd);
cmdret const c = do_popen(kpsecmd);
lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n"
<< "kpse result = `" << strip(c.second, '\n')

View File

@ -21,13 +21,13 @@
///
string CreateBufferTmpDir (string const & pathfor = string());
string const CreateBufferTmpDir (string const & pathfor = string());
/// Creates directory. Returns true on succes.
bool createDirectory(string const & name, int permissions);
///
string CreateLyXTmpDir (string const & deflt);
string const CreateLyXTmpDir (string const & deflt);
///
int DestroyBufferTmpDir (string const & tmpdir);
@ -42,7 +42,7 @@ int DestroyLyXTmpDir (string const & tmpdir);
If path entry begins with $$User/, use user_lyxdir.
Example: "$$User/doc;$$LyX/doc".
*/
string FileOpenSearch (string const & path, string const & name,
string const FileOpenSearch (string const & path, string const & name,
string const & ext = string());
/** Returns the real name of file name in directory path, with optional
@ -50,7 +50,7 @@ string FileOpenSearch (string const & path, string const & name,
The file is searched in the given path (unless it is an absolute
file name), first directly, and then with extension .ext (if given).
*/
string FileSearch(string const & path, string const & name,
string const FileSearch(string const & path, string const & name,
string const & ext = string());
/** Is directory read only?
@ -86,21 +86,22 @@ bool IsLyXFilename(string const & filename);
\end{enumerate}
The third parameter `ext' is optional.
*/
string LibFileSearch(string const & dir, string const & name,
string const LibFileSearch(string const & dir, string const & name,
string const & ext = string());
/** Same as LibFileSearch(), but tries first to find an
internationalized version of the file by prepending $LANG_ to the
name
*/
string i18nLibFileSearch(string const & dir, string const & name,
string const & ext = string());
string const
i18nLibFileSearch(string const & dir, string const & name,
string const & ext = string());
///
string GetEnv(string const & envname);
string const GetEnv(string const & envname);
/// A helper function.
string GetEnvPath(string const & name);
string const GetEnvPath(string const & name);
///
bool PutEnv(string const & envstr);
@ -109,51 +110,55 @@ bool PutEnv(string const & envstr);
bool PutEnvPath(string const & envstr);
/// Substitutes active latex characters with underscores in filename
string MakeLatexName(string const & file);
string const MakeLatexName(string const & file);
/// Put the name in quotes suitable for the current shell
string QuoteName(string const & file);
string const QuoteName(string const & file);
/** Returns an unique name to be used as a temporary file. If given,
'mask' should the prefix to the temporary file, the rest of the
temporary filename will be made from the pid and three letters.
*/
string TmpFileName(string const & dir = string(),
string const & mask = "lyx_tmp");
string const
TmpFileName(string const & dir = string(),
string const & mask = "lyx_tmp");
/// Is a filename/path absolute?
bool AbsolutePath(string const & path);
/// Add a filename to a path. Any path from filename is stripped first.
string AddName(string const & path, string const & fname);
string const AddName(string const & path, string const & fname);
/// Append sub-directory(ies) to path in an intelligent way
string AddPath(string const & path, string const & path2);
string const AddPath(string const & path, string const & path2);
/** Change extension of oldname to extension.
If oldname does not have an extension, it is appended.
If the extension is empty, any extension is removed from the name.
*/
string ChangeExtension(string const & oldname, string const & extension);
string const
ChangeExtension(string const & oldname, string const & extension);
/// Create absolute path. If impossible, don't do anything
string ExpandPath(string const & path);
string const ExpandPath(string const & path);
/// gets current working directory
string GetCWD();
string const GetCWD();
/** Convert relative path into absolute path based on a basepath.
If relpath is absolute, just use that.
If basepath doesn't exist use CWD.
*/
string MakeAbsPath(string const & RelPath = string(),
string const MakeAbsPath(string const & RelPath = string(),
string const & BasePath = string());
/** Creates a nice compact path for displaying. The parameter
threshold, if given, specifies the maximal length of the path.
*/
string MakeDisplayPath(string const & path, unsigned int threshold= 1000);
string const
MakeDisplayPath(string const & path,
unsigned int threshold = 1000);
/** Makes relative path out of absolute path.
If it is deeper than basepath,
@ -162,35 +167,36 @@ string MakeDisplayPath(string const & path, unsigned int threshold= 1000);
different, then the absolute path will be used as relative path
WARNING: the absolute path and base path must really be absolute paths!!!
*/
string MakeRelPath(string const & abspath, string const & basepath);
string const
MakeRelPath(string const & abspath, string const & basepath);
/// Strip filename from path name
string OnlyPath(string const & fname);
string const OnlyPath(string const & fname);
/// Normalize a path. Constracts path/../path
string NormalizePath(string const & path);
string const NormalizePath(string const & path);
/// Strips path from filename
string OnlyFilename(string const & fname);
string const OnlyFilename(string const & fname);
/// Get the contents of a file as a huge string
string GetFileContents(string const & fname);
string const GetFileContents(string const & fname);
/// Cleanup a path if necessary. Currently only useful with OS/2
string CleanupPath(string const & path) ;
string const CleanupPath(string const & path);
/** Check and Replace Environmentvariables ${NAME} in Path.
Replaces all occurences of these, if they are found in the
environment.
Variables are defined by Var := '${' [a-zA-Z_][a-zA-Z_0-9]* '}'
*/
string ReplaceEnvironmentPath(string const & path);
string const ReplaceEnvironmentPath(string const & path);
/* Set Link to the path file points to as a symbolic link.
Returns true if successful */
bool LyXReadLink(string const & file, string & Link);
/* Uses kpsewhich to find tex files */
string findtexfile(string const & fil, string const & format);
string const findtexfile(string const & fil, string const & format);
#endif

View File

@ -57,6 +57,8 @@ class Translator {
public:
typedef T1 first_argument_type;
typedef T2 second_argument_type;
typedef std::pair<T1, T2> MapPair;
typedef std::vector<MapPair> Map;
/// c-tor.
Translator(T1 const & t1, T2 const & t2)
@ -117,14 +119,10 @@ public:
}
private:
typedef std::pair<T1, T2> MapPair;
typedef std::vector<MapPair> Map;
Map map;
const T1 default_t1;
const T2 default_t2;
T1 const default_t1;
T2 const default_t2;
};
#endif

View File

@ -10,6 +10,8 @@
#include <config.h>
#include <algorithm>
#ifdef __GNUG__
#pragma implementation
#endif
@ -18,6 +20,7 @@
#include "lyxparagraph.h"
#include "debug.h"
using std::find_if;
// Delete linked list
void TexRow::reset()
@ -51,15 +54,29 @@ void TexRow::newline()
}
void TexRow::getIdFromRow(int row, int & id, int & pos) const
{
RowList::iterator cit = rowlist.begin();
RowList::iterator end = rowlist.end();
for (; cit != end; ++cit) {
if ((*cit).rownumber() == row) break;
class same_rownumber {
public:
same_rownumber(TexRow::RowList::value_type const & v):vt(v){}
bool operator()(TexRow::RowList::value_type const & vt1) const {
return vt.rownumber() == vt1.rownumber();
}
if (cit != end) {
private:
TexRow::RowList::value_type const & vt;
};
bool TexRow::getIdFromRow(int row, int & id, int & pos) const
{
RowList::value_type vt;
vt.rownumber(row);
RowList::const_iterator cit =
find_if(rowlist.begin(), rowlist.end(), same_rownumber(vt));
if (cit != rowlist.end()) {
#if 0
RowList::iterator kit = rowlist.begin();
RowList::iterator end = rowlist.end();
// Increase the pos of all rows with the
// same id (and where the pos is larger)
// to avoid putting errorinsets at the
@ -70,11 +87,40 @@ void TexRow::getIdFromRow(int row, int & id, int & pos) const
&& (*kit).pos() >= (*cit).pos())
(*kit).pos((*kit).pos() + 1);
}
#endif
id = (*cit).id();
pos = (*cit).pos();
} else {
id = -1;
pos = 0;
return true;
}
id = -1;
pos = 0;
return false;
}
// should perhaps have a better name...
// Increase the pos of all rows with the
// same id (and where the pos is larger)
// to avoid putting errorinsets at the
// same pos.
void TexRow::increasePos(int id, int pos) const
{
RowList::iterator kit = rowlist.begin();
RowList::iterator end = rowlist.end();
for(; kit != end; ++kit) {
if (id == (*kit).id()
&& pos < (*kit).pos()) {
(*kit).pos((*kit).pos() + 1);
lyxerr << "TeXRow::increasePos: ideally this "
"should never happen..." << endl;
}
// When verified to work this clause should be deleted.
if (id == (*kit).id()
&& pos == (*kit).pos()) {
lyxerr << "TexRow::increasePos: this should happen "
"maximum one time for each run of "
"increasePos!" << endl;
}
}
}

View File

@ -36,7 +36,7 @@ public:
void newline();
/// Returns paragraph id and position from a row number
void getIdFromRow(int row, int & id, int & pos) const;
bool getIdFromRow(int row, int & id, int & pos) const;
/// Appends another TexRow
TexRow & operator+= (TexRow const &);
@ -44,7 +44,6 @@ public:
/// Returns the number of rows in this texrow
int rows() const { return count; }
private:
/// Linked list of items
class RowItem {
public:
@ -83,10 +82,13 @@ private:
int rownumber_;
};
///
unsigned int count;
///
typedef std::list<RowItem> RowList;
///
void increasePos(int id, int pos) const;
private:
///
unsigned int count;
///
mutable RowList rowlist;
/// Last paragraph
LyXParagraph * lastpar;