On 04/06/2011 05:19 PM, Stephan Witt wrote:
The last changes regarding isWordSeparator and hard hyphens have a drawback...
Now the single dash enclosed by white space is treated as a single word and the
spell check marks it red - I'd rate this as a regression.

The attached patch should fix that. Ok to apply?

Stephan



bool Paragraph::isHardHyphen(pos_type pos) const
{
    pos_type const psize = size();
    if (pos >= psize)
        return false;
    char_type const c = d->text_[pos];
    if (c != '-')
        return false;
    int const nextpos = pos + 1;
    int const prevpos = pos > 0 ? pos - 1 : 0;
if ((pos == 0 || isSpace(prevpos)) && (nextpos == psize || isSpace(nextpos)))
                return false;
return (nextpos == psize || d->text_[nextpos] != '-') && (pos == 0 || d->text_[prevpos] != '-');
}



Reply via email to