Bug 60562 - type detection for binary XLS format broken on master
Summary: type detection for binary XLS format broken on master
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) Master
Hardware: Other All
: medium normal
Assignee: Kohei Yoshida
Whiteboard: target:4.1.0
Keywords: regression
Depends on:
Reported: 2013-02-10 01:04 UTC by Michael Stahl (allotropia)
Modified: 2013-03-07 06:49 UTC (History)
0 users

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2013-02-10 01:04:16 UTC
1. rename random .xls file to .tmp
2. File->Open it
3. maybe it opens as plain text in Writer, maybe not at all...
   (the latter if it's actually an embedded OLE that was written to a temp file)

apparently detection code has recently vanished from ScFilterDetect::detect
and ScExcelBiffDetect::detect does not actually detect anything at all.
Comment 1 Kohei Yoshida 2013-02-11 14:19:40 UTC
Do you have a test document I can use?
Comment 2 Kohei Yoshida 2013-02-11 14:20:24 UTC
(In reply to comment #1)
> Do you have a test document I can use?

I mean the embedded one.
Comment 3 Kohei Yoshida 2013-02-11 14:21:51 UTC
(In reply to comment #0)

> 2. File->Open it

And I bet you are opening it from Writer?
Comment 4 Michael Stahl (allotropia) 2013-02-11 14:25:09 UTC
forgot to add the bug link... see attachment there
Comment 5 Kohei Yoshida 2013-02-11 14:34:46 UTC
Attachment link:
Comment 6 Kohei Yoshida 2013-02-11 14:41:01 UTC
BTW, this (kinda) explains some of the not-so-obvious design in the type detection code.
Comment 7 Kohei Yoshida 2013-02-12 03:35:36 UTC
Adjusting the title a bit. It's not "totally broken" since it works just when opening from Calc.
Comment 8 Kohei Yoshida 2013-02-12 03:36:39 UTC
(In reply to comment #7)
> it works just when

it works just fine when
Comment 9 Kohei Yoshida 2013-03-05 17:05:08 UTC
Actually this is reproducible even with 3.6.  So it's not related to the recent change I did on master.  Still looking deeper.
Comment 10 Kohei Yoshida 2013-03-05 17:21:17 UTC
Actually I don't get this bug.  I just created a Word document with embedded Excel object, and I can open the embedded Excel just fine using the master build.  So, that has nothing to do with libreoffice not opening an excel doc with .tmp extension....

I must be missing something here.. :-/
Comment 11 Kohei Yoshida 2013-03-05 17:25:16 UTC
Anyway, I'll just focus on opening an Excel file with .tmp extension from Writer UI.
Comment 12 Kohei Yoshida 2013-03-05 18:58:41 UTC
Ah, I see how the new type detection code is handling this use case differently.
Comment 13 Commit Notification 2013-03-07 06:45:02 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":


fdo#60562: List *all* format types that we support and rank them all properly.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
Comment 14 Kohei Yoshida 2013-03-07 06:48:23 UTC
Ok.  Just did a non-trivial refactoring of the type detection code (something I had planned to do regardless of this bug), and now the Excel file with .tmp extension gets detected correctly.  I also loaded the document from Bug 60234, and it loads fine too.

The type detection process is a bit more simplified more logical now, which I'm very happy about.
Comment 15 Kohei Yoshida 2013-03-07 06:49:23 UTC
Fixed on master.