Improving type detection

Maxim Monastirsky momonasmon at
Thu May 1 05:44:35 PDT 2014

Hi everybody,

As some of you probably know, some of the type detection services aren't in 
very good shape. They share a lot of copy-pasted code (that deals with ZIP 
based formats), and also don't fit so well into the detection framework. Things 
like dealing with pre-selected filters, URL patterns, opening a stream, and 
selecting the best filter for a given type are already covered by the 
framework. Also such service doesn't necessarily need to check in each run 
against all supported types, just for one given type. Not to mention the 
Writer detection which is full of old hacks and hard to follow code.

I'm trying to improve that situation. So I introduced a new centralized 
service which is responsible for detecting ZIP storage-based formats, and 
removed all the duplicated code from the other services. Later I cleaned those 
services from some hacks, and simplified them.

I'm not feeling comfortable with doing such changes without a prior 
discussion, and I'd like first to receive a feedback on this. So I submitted 
what I have done so far to gerrit:

Any kind of feedback would be appreciated!


More information about the LibreOffice mailing list