LCLIntf: Remove redundant IsQuoted from OpenURL (if IsFileUriWithSpaces then IsQuoted is always false).

git-svn-id: trunk@40491 -
This commit is contained in:
bart 2013-03-06 10:40:41 +00:00
parent 6e06c2f634
commit fe29021310

View File

@ -8,7 +8,7 @@ var
{$ELSE}
ws: WideString;
ans: AnsiString;
IsFileUriWithSpaces, IsQuoted: Boolean;
IsFileUriWithSpaces: Boolean;
const
FileURIScheme = 'file://';
{$ENDIF}
@ -29,8 +29,7 @@ begin
//but on Win9x quoting it fails
//Since on Windows filenames cannot contain the " character, we need not care about it and simply enclose the AURL
IsFileUriWithSpaces := (Pos(#32,AURL) > 0) and (CompareText(Copy(AURL,1,Length(FileURIScheme)), FileURIScheme) = 0);
IsQuoted := (Length(AURL) > 1) and (AURL[1] = '"') and (AURL[Length(AURL)] = '"');
if IsFileUriWithSpaces and not IsQuoted then AURL := '"' + AURL + '"';
if IsFileUriWithSpaces then AURL := '"' + AURL + '"';
ws := UTF8Decode(AURL);
Result := ShellExecuteW(0, nil, PWideChar(ws), nil, nil, SW_SHOWNORMAL) > 32;
end