Hugo Vincent wrote:
> Hi,
>
> I'm trying to fix the end-user problem I'm having (quoted below), and think 
> I found the source of the problem.
>
> Around line 121 in Format.cpp:
> string Formats::getFormatFromFile(FileName const & filename) const
> {
> <snip>
>       string const format = filename.guessFormatFromContents();
>       if (!format.empty())
>               return format;
>
>       // try to find a format from the file extension.
>       string const ext = getExtension(filename.absFilename());
> <snip>
> }
>
> So it only looks at file extension in the case where 
> guessFormatFromContents can't guess - that seems wrong. It should get the 
> format from looking up the extension (same list of formats as the Formats 
> editor in Preferences), and if that fails (or there is no extension) _then_ 
> it should try to guess based on content. Unless there is some complexity 
> that hasn't occurred to me, it seems flipping the order of these two tests 
> in Formats::getFormatFromFile would result in more correct (not to mention 
> more configurable) behavior.

looks reasonable on the first sight. but even if we change it should go to
trunk only, since its touching so sensitive area that we can't afford to risk
this in branch. feel free to send a patch.

pavel

Reply via email to