Lars Gullik Bjønnes wrote:

> | +           if (idx != string::npos) 
> | +                   if (idx > 0)    // ignore all right of %
> | +                           dummy = dummy.substr(
> | +                                   0, dummy.length() - dummy.find('%'));
> 
> (What a horrible variable name...)


look into text.C, then you see what's horrible ...


> dummy.erase(dummy.find('%'), string::npos);  // possibly + 1 or - 1
> 
> | +                   else            // ignore all
> | +                           dummy = "";
> 
> dummy.erase();
> 
> also this if clause is just not needed:
> 
>      dummy.erase(idx, string::npos);
> 
> should cover it all.


seems so, but it does bang with this line
dummy.erase(dummy.find('%'), string::npos);


lyx: /usr/include/g++/std/bastring.cc:192: class 
basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> 
 > & 
basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> 
 >::replace(unsigned int, unsigned int, unsigned int, char): Assertion 
`!(pos > len)' failed.
Aborted

> 
> | +           // do we have a new token or a new line of
> | +           // the same one? In the first case we ignore
> | +           // the \n and in the second we replace it
> | +           // with a space
> | +           if (!dummy.empty()) {
> | +                   if (!contains(dummy, "="))
> | +                           data_ += (' ' + dummy); 
> | +                   else
> | +                           data_ += dummy;
> 
> This check looks wrong... what if dummy == "=equal" or "equal=", it
> does not seem that it is unimportant where in the string the '=' is.


I do not understand. I want to know if there is a "=", nothing
more

Herbert



-- 
http://www.lyx.org/help/

Reply via email to