You've already forked lazarus-ccr
fpspreadsheet: Fix issue 0025133 "Cannot read xls file apparently BIFF5". Fix error message when writing a too-long cell text to BIFF5.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3653 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -109,6 +109,7 @@
|
|||||||
<Unit15>
|
<Unit15>
|
||||||
<Filename Value="errortests.pas"/>
|
<Filename Value="errortests.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="errortests"/>
|
||||||
</Unit15>
|
</Unit15>
|
||||||
<Unit16>
|
<Unit16>
|
||||||
<Filename Value="virtualmodetests.pas"/>
|
<Filename Value="virtualmodetests.pas"/>
|
||||||
|
@ -228,21 +228,28 @@ var
|
|||||||
Splitted: TStringList;
|
Splitted: TStringList;
|
||||||
j: integer;
|
j: integer;
|
||||||
SIDChild: SID;
|
SIDChild: SID;
|
||||||
|
|
||||||
function FindSiblingWithName(const AName: WideString; const AStartSibling: integer): SID;
|
function FindSiblingWithName(const AName: WideString; const AStartSibling: integer): SID;
|
||||||
|
var
|
||||||
|
n, ab: WideString;
|
||||||
|
begin
|
||||||
|
n := UpperCase(AName);
|
||||||
|
ab := UpperCase(FDirectory[AStartSibling]._ab);
|
||||||
|
if (n = ab) and (FDirectory[AStartSibling]._mse <> BYTE(STGTY_INVALID)) then
|
||||||
begin
|
begin
|
||||||
if (FDirectory[AStartSibling]._ab=AName) and (FDirectory[AStartSibling]._mse<>BYTE(STGTY_INVALID)) then begin
|
|
||||||
Result:=FDirectory[AStartSibling]._sidChild;
|
Result:=FDirectory[AStartSibling]._sidChild;
|
||||||
end else begin
|
end else
|
||||||
|
begin
|
||||||
Result:=WINCOMPOUND_NOSID;
|
Result:=WINCOMPOUND_NOSID;
|
||||||
if FDirectory[AStartSibling]._sidLeftSib<>WINCOMPOUND_NOSID then begin
|
if FDirectory[AStartSibling]._sidLeftSib<>WINCOMPOUND_NOSID then
|
||||||
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidLeftSib);
|
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidLeftSib);
|
||||||
end;
|
if Result<>WINCOMPOUND_NOSID then
|
||||||
if Result<>WINCOMPOUND_NOSID then exit;
|
exit;
|
||||||
if FDirectory[AStartSibling]._sidRightSib<>WINCOMPOUND_NOSID then begin
|
if FDirectory[AStartSibling]._sidRightSib<>WINCOMPOUND_NOSID then
|
||||||
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidRightSib);
|
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidRightSib);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
begin
|
begin
|
||||||
Splitted:=TStringList.Create;
|
Splitted:=TStringList.Create;
|
||||||
SplitPath(APath,Splitted);
|
SplitPath(APath,Splitted);
|
||||||
@ -265,21 +272,26 @@ var
|
|||||||
Splitted: TStringList;
|
Splitted: TStringList;
|
||||||
j: integer;
|
j: integer;
|
||||||
SIDChild: SID;
|
SIDChild: SID;
|
||||||
|
|
||||||
function FindSiblingWithName(const AName: WideString; const AStartSibling: integer): SID;
|
function FindSiblingWithName(const AName: WideString; const AStartSibling: integer): SID;
|
||||||
|
var
|
||||||
|
n, ab: WideString;
|
||||||
begin
|
begin
|
||||||
if (FDirectory[AStartSibling]._ab=AName) and (FDirectory[AStartSibling]._mse<>BYTE(STGTY_INVALID)) then begin
|
n := UpperCase(AName);
|
||||||
Result:=AStartSibling;
|
ab := UpperCase(FDirectory[AStartSibling]._ab);
|
||||||
end else begin
|
if (n = ab) and (FDirectory[AStartSibling]._mse <> BYTE(STGTY_INVALID)) then
|
||||||
|
Result := AStartSibling
|
||||||
|
else begin
|
||||||
Result:=WINCOMPOUND_NOSID;
|
Result:=WINCOMPOUND_NOSID;
|
||||||
if FDirectory[AStartSibling]._sidLeftSib<>WINCOMPOUND_NOSID then begin
|
if FDirectory[AStartSibling]._sidLeftSib<>WINCOMPOUND_NOSID then
|
||||||
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidLeftSib);
|
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidLeftSib);
|
||||||
end;
|
if Result<>WINCOMPOUND_NOSID then
|
||||||
if Result<>WINCOMPOUND_NOSID then exit;
|
exit;
|
||||||
if FDirectory[AStartSibling]._sidRightSib<>WINCOMPOUND_NOSID then begin
|
if FDirectory[AStartSibling]._sidRightSib<>WINCOMPOUND_NOSID then
|
||||||
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidRightSib);
|
Result:=FindSiblingWithName(AName,FDirectory[AStartSibling]._sidRightSib);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
begin
|
begin
|
||||||
Splitted:=TStringList.Create;
|
Splitted:=TStringList.Create;
|
||||||
SplitPath(APath,Splitted);
|
SplitPath(APath,Splitted);
|
||||||
|
@ -785,7 +785,7 @@ begin
|
|||||||
// Rather than lose data when reading it, let the application programmer deal
|
// Rather than lose data when reading it, let the application programmer deal
|
||||||
// with the problem or purposefully ignore it.
|
// with the problem or purposefully ignore it.
|
||||||
AnsiValue := Copy(AnsiValue, 1, MAXBYTES);
|
AnsiValue := Copy(AnsiValue, 1, MAXBYTES);
|
||||||
Workbook.AddErrorMsg(rsInvalidCharacterInCell, [
|
Workbook.AddErrorMsg(rsTruncateTooLongCellText, [
|
||||||
MAXBYTES, GetCellString(ARow, ACol)
|
MAXBYTES, GetCellString(ARow, ACol)
|
||||||
]);
|
]);
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user