Jean-Marc Lasgouttes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Looks like you have a strategy of moving as many free-standing
functions as possible to Paragraph methods. What is the gain?
Speed, encapsulation...
Does passing a paragraph by reference make any difference wrt passing
it as 'this'? I seriously doubt it.
The moment you use interface methods in a loop for accessing the full
contents of the paragraph, then yes, affirmatively yes. Why do you think
the access methods were inlined?
The problem is not really the fatness of classes but the fatness of
methods and helper functions. Note that by moving some helpers methods
to the class we will most certainly get rid of most of the interfaces
which will then be useless. In this case, I am thinking of getChar(),
isInset(), isDeleted() etc. The end result will be a slimmer class,
not a fatter one :-)
I am a bit skeptical that we can get rid of something as fundamental
wrt the concept of paragraph as getChar...
I am not. The only problematic case is in "rowpainter.cpp" which is
still a mess and needs to be killed anyway. In src/, only those remains:
output_latex.cpp(378): char_type const c = pit->getChar(i);
paragraph_funcs.cpp(38): char_type const tmpChar =
ParagraphMetrics.cpp(104): char_type const b[] = {
ParagraphMetrics.cpp(222): char_type c = par_->getChar(pos);
rowpainter.cpp(190): char_type c = par_.getChar(pos);
rowpainter.cpp(198): c = par_.getChar(i);
rowpainter.cpp(223): char_type c = par_.getChar(pos);
rowpainter.cpp(232): c = par_.getChar(i);
rowpainter.cpp(259): str.push_back(par_.getChar(pos));
rowpainter.cpp(279): char_type c = par_.getChar(pos);
rowpainter.cpp(360): char_type const c = par_.getChar(pos);
Text.cpp(460): char_type const c = Text.cpp(1258): size_t const c =
par.getChar(cur.pos());
Text.cpp(1375): char_type char1 = par.getChar(pos1);
Text.cpp(1379): char_type char2 = par.getChar(pos2);
Text3.cpp(903): c = par.getChar(pos - 1);
Abdel.