[Libreoffice] Patch for ignoring preceding and trailing spaces in cell during csv import

Michael Meeks michael.meeks at novell.com
Tue Dec 14 07:52:53 PST 2010


Hi there,

On Mon, 2010-12-13 at 16:28 -0500, Kohei Yoshida wrote:
> I'd like to port a patch to the libreoffice-3-3 branch to ignore
> preceding and trailing spaces in cells during csv import.

	I just wrote a set of unit tests for this; in sc/qa/unit/ something
like:

    struct {
        const char *pStr; int eSep; bool bResult; double nValue;
    } aTests[] = {
        { "foo",       English,  false, 0.0 },
        { "1.0",       English,  true,  1.0 },
        { "1,0",       English,  false, 0.0 },
        { "1.0",       European, false, 0.0 },
        { "1.000",     European, true,  1000.0 },
        { "1,000",     European, true,  1.0 },
        { "1.000",     English,  true,  1.0 },
        { "1,000",     English,  true,  1000.0 },
        { " 1.0",      English,  true,  1.0 },
        { " 1.0  ",    English,  true,  1.0 },
        { "1.0 ",      European, false, 0.0 },
        { "1.000",     European, true,  1000.0 },
        { "1137.999",  English,  true,  1137.999 },
        { "1.000.00",  European, false, 0.0 }
    };

	Which all pass just fine; so it seems fine to me. People with more
tortured minds / tests welcome there.

	Thanks,

		Michael.

-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot




More information about the LibreOffice mailing list