Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: >>>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > | Lars> Is the logic in this loop correct? Wont the start positon always | Lars> just be one smaller than the end pos? > | I believe it is correct. It is the logic of the fonttable that is | really twisted. Note however that I did not have an occasion to test | that the start of the font span is correct, since I do not use rtl | documents. > | Basically, cit->pos() always represents then last position (inclusive) | of a font span. > | Lars> Ok... I see... that is what is happeing, but is the " - 1" then | Lars> correct? Shouldn't that be "+ 1"? > | I think you are right :) I'll double check tomorrow. > | Lars> Perhaps a bit nicer to use boost::prior anyway. a tiny bit more | Lars> clear? > | I do not think so, especially since it will not work for the first span.
I won't with -1 or +1 either :-), you need to check first span either way. | Lars> Should we enforce this to never happen? Or does it actually | Lars> happen? > | No idea. I left it as it was. I can assert on it if you want. Nah... | Lars> | // first character | Lars> |- string str; > | Lars> Why move strint str up? > | I do not know, I just moved stuff around. > | Lars> | str += par_.getChar(pos); > | Lars> string str(1, par_.getChar(pos); > | Why is it better? do the work on initialization... only that. | Lars> Please do something like this instead: > | Lars> #if QT_VERSION < 0x030100 # define USE_LYX_FONTCACHE 1 #else # | Lars> define USE_LYX_FONTCACHE 0 #endif > | Yes. > | Lars> This can then become (beware... new syntax): > | I am not sure I like it... Doesn't the compiler give warnings on that? Why? I can live with #if USE_LYX_FONTCACHE as well. if just thought the if (USE_LYX_FONTCACHE) { syntax neat. /avoiding all those pesky preprocessor directives./ -- Lgb