You've already forked lazarus-ccr
fpspreadsheet: Fix hyperlinks tests under Linux
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4008 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1570,7 +1570,8 @@ begin
|
||||
displayTxt := ATarget;
|
||||
if pos('file:', lowercase(displayTxt))=1 then
|
||||
begin
|
||||
Delete(displayTxt, 1, Length('file:///'));
|
||||
URIToFilename(displayTxt, displayTxt);
|
||||
// Delete(displayTxt, 1, Length('file:///'));
|
||||
ForcePathDelims(displayTxt);
|
||||
if bm <> '' then displayTxt := fn + '#' + bm;
|
||||
end;
|
||||
@ -3641,7 +3642,8 @@ begin
|
||||
AText := hyperlink.Target;
|
||||
if pos('file:', hyperlink.Target)=1 then
|
||||
begin
|
||||
Delete(AText, 1, Length('file:///'));
|
||||
URIToFileName(AText, AText);
|
||||
// Delete(AText, 1, Length('file:///'));
|
||||
ForcePathDelims(AText);
|
||||
end;
|
||||
end;
|
||||
|
@ -95,7 +95,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
lazfileutils, fpsutils;
|
||||
uriparser, lazfileutils, fpsutils;
|
||||
|
||||
const
|
||||
HyperlinkSheet = 'Hyperlinks';
|
||||
@ -127,12 +127,15 @@ var
|
||||
procedure TSpreadWriteReadHyperlinkTests.SetUp;
|
||||
var
|
||||
i: Integer;
|
||||
fn: String;
|
||||
begin
|
||||
inherited SetUp;
|
||||
for i:=Low(SollLinks) to High(SollLinks) do
|
||||
if SollLinks[i] = 'file:///' then
|
||||
begin
|
||||
SollLinks[i] := 'file:///' + ExpandFileName('testbiff8_1899.xls');
|
||||
fn := ExpandFileName('testbiff8_1899.xls');
|
||||
FilenameToURI(fn);
|
||||
SollLinks[i] := fn;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
@ -1526,7 +1526,8 @@ begin
|
||||
|
||||
// An absolute path must be a fully qualified URI to be compatible with fps
|
||||
if flags and MASK_HLINK_ABSOLUTE <> 0 then
|
||||
link := 'file:///' + link;
|
||||
FilenameToURI(link);
|
||||
// link := 'file:///' + link;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -2812,7 +2812,8 @@ begin
|
||||
if target <> '' then
|
||||
begin
|
||||
if (pos('file:', target) = 0) and FileNameIsAbsolute(target) then
|
||||
target := 'file:///' + target;
|
||||
FileNameToURI(target);
|
||||
// target := 'file:///' + target;
|
||||
s := Format('Id="rId%d" Type="%s" Target="%s" TargetMode="External"',
|
||||
[FNext_rId, SCHEMAS_HYPERLINKS, target]);
|
||||
AppendToStream(FSSheetRels[FCurSheetNum],
|
||||
|
Reference in New Issue
Block a user