https://bugs.kde.org/show_bug.cgi?id=521760

Dawid Wróbel <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #2 from Dawid Wróbel <[email protected]> ---
While I was working on CSV code last week, I found that the decimal/thousand
parsing code is all over the place:
Some parts of the call only such code:
        if (txt.startsWith(QLatin1Char('('))) {
            txt.remove(QRegularExpression(QStringLiteral("[()]")));
            txt.prepend(QLatin1Char('-'));
Some only such:
        txt = m_file->m_parse->possiblyReplaceSymbol(txt);
Some both. Meanwhile possiblyReplaceSymbol() itself should already handle
bracket processing:
   if (txt.contains(QLatin1Char('('))) // (1.23) is in fact -1.23
        parentheses = true;

Another problem is that the regex in possiblyReplaceSymbol() doesn't do what
its author thought it would:
txt.remove(QRegularExpression(QStringLiteral("\\D.,-+")));

This effectively attempts to remove e.g. an "Xc,-" string, instead removing any
non-digit character...

All this needs revising for sure and I imagine this can be causing issues like
this one here.

@Barnaby, can you please include a sample CSV file that you can reproduce this
issue with?

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to