Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


https://bugs.freedesktop.org/show_bug.cgi?id=55786

Thomas Kluyver <thomas@kluyver.me.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thomas@kluyver.me.uk

--- Comment #13 from Thomas Kluyver <thomas@kluyver.me.uk> ---
I had to spend a while digging into an old WK4 file to extract some data. I
thought I'd document my main finding here:

opcode 0x17 appears to be a 10-byte extended precision float. After the record
header, there is a two byte row number, one byte sheet number, and one byte
column number. These are common to a few record types. The remainder of it is
the value, in the format described here:

http://en.wikipedia.org/wiki/Extended_precision#x86_Extended_Precision_Format

I was able to extract these, at least for the small positive numbers in my
sample, using the following Python code:

        a = int.from_bytes(r.data[-2:], 'little')
        sign = -1 if (a & (1<<15)) else 1
        e = a - (a & (1 << 15)) - 16383
        m = int.from_bytes(r.data[4:-2], 'little')
        val = m / (1<<(63-e))

0x16 is a label, with the same row/sheet/column fields.

I started looking into making a patch, but I got confused because there appear
to be opcode lookup tables both in optab.cxx and as switch statements in
lotread.cxx, with different opcodes in them.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.