You've already forked lazarus-ccr
fpspreadsheet: Add some forgotten comments on xls format detection
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3878 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -6782,9 +6782,12 @@ begin
|
|||||||
if not FileExists(AFileName) then
|
if not FileExists(AFileName) then
|
||||||
raise Exception.CreateFmt(rsFileNotFound, [AFileName]);
|
raise Exception.CreateFmt(rsFileNotFound, [AFileName]);
|
||||||
|
|
||||||
|
// .xls files can contain several formats. We look into the header first.
|
||||||
if Lowercase(ExtractFileExt(AFileName))=STR_EXCEL_EXTENSION then
|
if Lowercase(ExtractFileExt(AFileName))=STR_EXCEL_EXTENSION then
|
||||||
begin
|
begin
|
||||||
valid := GetFormatFromFileHeader(AFileName, SheetType);
|
valid := GetFormatFromFileHeader(AFileName, SheetType);
|
||||||
|
// It is possible that valid xls files are not detected correctly. Therefore,
|
||||||
|
// we open them explicitly by trial and error - see below.
|
||||||
if not valid then
|
if not valid then
|
||||||
SheetType := sfExcel8;
|
SheetType := sfExcel8;
|
||||||
valid := true;
|
valid := true;
|
||||||
@ -6795,6 +6798,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if SheetType = sfExcel8 then
|
if SheetType = sfExcel8 then
|
||||||
begin
|
begin
|
||||||
|
// Here is the trial-and-error loop checking for the various biff formats.
|
||||||
while True do
|
while True do
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
|
Reference in New Issue
Block a user