Fixes for Delphi XE2
Fixed compatibility with D2007
This commit is contained in:
parent
020b8eaeb6
commit
06e559505d
@ -58,6 +58,6 @@ contains
|
|||||||
X2UtElevation in '..\..\X2UtElevation.pas',
|
X2UtElevation in '..\..\X2UtElevation.pas',
|
||||||
X2UtPersistXML in '..\..\X2UtPersistXML.pas',
|
X2UtPersistXML in '..\..\X2UtPersistXML.pas',
|
||||||
X2UtPersistXMLBinding in '..\..\X2UtPersistXMLBinding.pas',
|
X2UtPersistXMLBinding in '..\..\X2UtPersistXMLBinding.pas',
|
||||||
XMLDataBindingUtils in '..\..\XMLDataBinding\XMLDataBindingUtils.pas';
|
XMLDataBindingUtils in '..\..\XMLDataBindingUtils.pas';
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
<PropertyGroup Condition="'$(Base_Win32)'!=''">
|
||||||
<Icon_MainIcon>X2Utils_Icon.ico</Icon_MainIcon>
|
<Icon_MainIcon>X2Utils_Icon.ico</Icon_MainIcon>
|
||||||
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
<DCC_Namespace>Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
|
||||||
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
|
||||||
<VerInfo_Locale>1033</VerInfo_Locale>
|
<VerInfo_Locale>1033</VerInfo_Locale>
|
||||||
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
|
||||||
@ -172,7 +172,7 @@
|
|||||||
<DCCReference Include="..\..\X2UtElevation.pas"/>
|
<DCCReference Include="..\..\X2UtElevation.pas"/>
|
||||||
<DCCReference Include="..\..\X2UtPersistXML.pas"/>
|
<DCCReference Include="..\..\X2UtPersistXML.pas"/>
|
||||||
<DCCReference Include="..\..\X2UtPersistXMLBinding.pas"/>
|
<DCCReference Include="..\..\X2UtPersistXMLBinding.pas"/>
|
||||||
<DCCReference Include="..\..\XMLDataBinding\XMLDataBindingUtils.pas"/>
|
<DCCReference Include="..\..\XMLDataBindingUtils.pas"/>
|
||||||
<BuildConfiguration Include="Debug">
|
<BuildConfiguration Include="Debug">
|
||||||
<Key>Cfg_2</Key>
|
<Key>Cfg_2</Key>
|
||||||
<CfgParent>Base</CfgParent>
|
<CfgParent>Base</CfgParent>
|
||||||
|
Binary file not shown.
@ -122,6 +122,11 @@
|
|||||||
// so I don't know what defines they have... if you do know,
|
// so I don't know what defines they have... if you do know,
|
||||||
// feel free to send me any changes...
|
// feel free to send me any changes...
|
||||||
{$IFDEF DUNKNOWN}
|
{$IFDEF DUNKNOWN}
|
||||||
|
{$DEFINE DXE2PLUS}
|
||||||
|
{$DEFINE DXEPLUS}
|
||||||
|
{$DEFINE D2010PLUS}
|
||||||
|
{$DEFINE D2009PLUS}
|
||||||
|
{$DEFINE D2007PLUS}
|
||||||
{$DEFINE D2006PLUS}
|
{$DEFINE D2006PLUS}
|
||||||
{$DEFINE D2005PLUS}
|
{$DEFINE D2005PLUS}
|
||||||
{$DEFINE D8PLUS}
|
{$DEFINE D8PLUS}
|
||||||
@ -133,3 +138,4 @@
|
|||||||
{$DEFINE D2PLUS}
|
{$DEFINE D2PLUS}
|
||||||
{$DEFINE D1PLUS}
|
{$DEFINE D1PLUS}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
@ -176,9 +176,9 @@ begin
|
|||||||
param := AParams[paramIndex];
|
param := AParams[paramIndex];
|
||||||
|
|
||||||
case param.VType of
|
case param.VType of
|
||||||
vtChar: name := param.VChar;
|
vtChar: name := string(param.VChar);
|
||||||
vtString: name := param.VString^;
|
vtString: name := string(param.VString^);
|
||||||
vtPChar: name := param.VPChar;
|
vtPChar: name := string(param.VPChar);
|
||||||
vtAnsiString: name := PChar(param.VAnsiString);
|
vtAnsiString: name := PChar(param.VAnsiString);
|
||||||
else
|
else
|
||||||
raise Exception.CreateFmt('Parameter name at index %d is not a string value',
|
raise Exception.CreateFmt('Parameter name at index %d is not a string value',
|
||||||
|
@ -278,7 +278,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
if StrLen(versionInfo.szCSDVersion) > 0 then
|
if StrLen(versionInfo.szCSDVersion) > 0 then
|
||||||
VersionString := VersionString + ' ' + versionInfo.szCSDVersion;
|
VersionString := VersionString + ' ' + string(versionInfo.szCSDVersion);
|
||||||
|
|
||||||
case versionInfo.dwPlatformId of
|
case versionInfo.dwPlatformId of
|
||||||
VER_PLATFORM_WIN32_NT:
|
VER_PLATFORM_WIN32_NT:
|
||||||
|
@ -112,6 +112,9 @@ uses
|
|||||||
X2UtStrings;
|
X2UtStrings;
|
||||||
|
|
||||||
|
|
||||||
|
{$I X2UtCompilerVersion.inc}
|
||||||
|
|
||||||
|
|
||||||
type
|
type
|
||||||
{ This class has to proxy all the interfaces in order for
|
{ This class has to proxy all the interfaces in order for
|
||||||
reference counting to go through this class. }
|
reference counting to go through this class. }
|
||||||
@ -348,15 +351,15 @@ begin
|
|||||||
tkInteger,
|
tkInteger,
|
||||||
tkChar,
|
tkChar,
|
||||||
tkWChar:
|
tkWChar:
|
||||||
if ReadInteger(APropInfo^.Name, ordValue) then
|
if ReadInteger(string(APropInfo^.Name), ordValue) then
|
||||||
SetOrdProp(AObject, APropInfo, ordValue);
|
SetOrdProp(AObject, APropInfo, ordValue);
|
||||||
|
|
||||||
tkFloat:
|
tkFloat:
|
||||||
if ReadFloat(APropInfo^.Name, floatValue) then
|
if ReadFloat(string(APropInfo^.Name), floatValue) then
|
||||||
SetFloatProp(AObject, APropInfo, floatValue);
|
SetFloatProp(AObject, APropInfo, floatValue);
|
||||||
|
|
||||||
tkEnumeration:
|
tkEnumeration:
|
||||||
if ReadString(APropInfo^.Name, stringValue) then
|
if ReadString(string(APropInfo^.Name), stringValue) then
|
||||||
begin
|
begin
|
||||||
ordValue := GetEnumValue(APropInfo^.PropType^, stringValue);
|
ordValue := GetEnumValue(APropInfo^.PropType^, stringValue);
|
||||||
if ordValue >= 0 then
|
if ordValue >= 0 then
|
||||||
@ -364,14 +367,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
tkString,
|
tkString,
|
||||||
|
{$IFDEF D2009PLUS}
|
||||||
|
tkUString,
|
||||||
|
{$ENDIF}
|
||||||
tkLString,
|
tkLString,
|
||||||
tkWString,
|
tkWString:
|
||||||
tkUString:
|
if ReadString(string(APropInfo^.Name), stringValue) then
|
||||||
if ReadString(APropInfo^.Name, stringValue) then
|
|
||||||
SetStrProp(AObject, APropInfo, stringValue);
|
SetStrProp(AObject, APropInfo, stringValue);
|
||||||
|
|
||||||
tkSet:
|
tkSet:
|
||||||
if ReadString(APropInfo^.Name, stringValue) then
|
if ReadString(string(APropInfo^.Name), stringValue) then
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
ordValue := StringToSet(APropInfo, stringValue);
|
ordValue := StringToSet(APropInfo, stringValue);
|
||||||
@ -382,11 +387,11 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
tkVariant:
|
tkVariant:
|
||||||
if ReadVariant(APropInfo^.Name, variantValue) then
|
if ReadVariant(string(APropInfo^.Name), variantValue) then
|
||||||
SetVariantProp(AObject, APropInfo, variantValue);
|
SetVariantProp(AObject, APropInfo, variantValue);
|
||||||
|
|
||||||
tkInt64:
|
tkInt64:
|
||||||
if ReadInt64(APropInfo^.Name, int64Value) then
|
if ReadInt64(string(APropInfo^.Name), int64Value) then
|
||||||
SetInt64Prop(AObject, APropInfo, int64Value);
|
SetInt64Prop(AObject, APropInfo, int64Value);
|
||||||
|
|
||||||
tkClass:
|
tkClass:
|
||||||
@ -396,11 +401,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
if objectProp is TStream then
|
if objectProp is TStream then
|
||||||
begin
|
begin
|
||||||
ReadStream(APropInfo^.Name, TStream(objectProp));
|
ReadStream(string(APropInfo^.Name), TStream(objectProp));
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
{ Recurse into object properties }
|
{ Recurse into object properties }
|
||||||
if BeginSection(APropInfo^.Name) then
|
if BeginSection(string(APropInfo^.Name)) then
|
||||||
try
|
try
|
||||||
AContinue := Read(objectProp);
|
AContinue := Read(objectProp);
|
||||||
finally
|
finally
|
||||||
@ -457,35 +462,38 @@ begin
|
|||||||
tkWChar:
|
tkWChar:
|
||||||
begin
|
begin
|
||||||
ordValue := GetOrdProp(AObject, APropInfo);
|
ordValue := GetOrdProp(AObject, APropInfo);
|
||||||
WriteInteger(APropInfo^.Name, ordValue);
|
WriteInteger(string(APropInfo^.Name), ordValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tkFloat:
|
tkFloat:
|
||||||
begin
|
begin
|
||||||
floatValue := GetFloatProp(AObject, APropInfo);
|
floatValue := GetFloatProp(AObject, APropInfo);
|
||||||
WriteFloat(APropInfo^.Name, floatValue);
|
WriteFloat(string(APropInfo^.Name), floatValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tkEnumeration:
|
tkEnumeration:
|
||||||
begin
|
begin
|
||||||
ordValue := GetOrdProp(AObject, APropInfo);
|
ordValue := GetOrdProp(AObject, APropInfo);
|
||||||
stringValue := GetEnumName(APropInfo^.PropType^, ordValue);
|
stringValue := GetEnumName(APropInfo^.PropType^, ordValue);
|
||||||
WriteString(APropInfo^.Name, stringValue);
|
WriteString(string(APropInfo^.Name), stringValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tkString,
|
tkString,
|
||||||
|
{$IFDEF D2009PLUS}
|
||||||
|
tkUString,
|
||||||
|
{$ENDIF}
|
||||||
tkLString,
|
tkLString,
|
||||||
tkWString:
|
tkWString:
|
||||||
begin
|
begin
|
||||||
stringValue := GetStrProp(AObject, APropInfo);
|
stringValue := GetStrProp(AObject, APropInfo);
|
||||||
WriteString(APropInfo^.Name, stringValue);
|
WriteString(string(APropInfo^.Name), stringValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tkSet:
|
tkSet:
|
||||||
begin
|
begin
|
||||||
ordValue := GetOrdProp(AObject, APropInfo);
|
ordValue := GetOrdProp(AObject, APropInfo);
|
||||||
stringValue := SetToString(APropInfo, ordValue, True);
|
stringValue := SetToString(APropInfo, ordValue, True);
|
||||||
WriteString(APropInfo^.Name, stringValue);
|
WriteString(string(APropInfo^.Name), stringValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tkVariant:
|
tkVariant:
|
||||||
@ -496,7 +504,7 @@ begin
|
|||||||
tkInt64:
|
tkInt64:
|
||||||
begin
|
begin
|
||||||
int64Value := GetInt64Prop(AObject, APropInfo);
|
int64Value := GetInt64Prop(AObject, APropInfo);
|
||||||
WriteInt64(APropInfo^.Name, int64Value);
|
WriteInt64(string(APropInfo^.Name), int64Value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
tkClass:
|
tkClass:
|
||||||
@ -506,11 +514,11 @@ begin
|
|||||||
begin
|
begin
|
||||||
if objectProp is TStream then
|
if objectProp is TStream then
|
||||||
begin
|
begin
|
||||||
WriteStream(APropInfo^.Name, TStream(objectProp));
|
WriteStream(string(APropInfo^.Name), TStream(objectProp));
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
{ Recurse into object properties }
|
{ Recurse into object properties }
|
||||||
if BeginSection(APropInfo^.Name) then
|
if BeginSection(string(APropInfo^.Name)) then
|
||||||
try
|
try
|
||||||
Write(objectProp);
|
Write(objectProp);
|
||||||
finally
|
finally
|
||||||
|
@ -25,6 +25,8 @@ uses
|
|||||||
Windows;
|
Windows;
|
||||||
|
|
||||||
|
|
||||||
|
{$I X2UtCompilerVersion.inc}
|
||||||
|
|
||||||
|
|
||||||
function GetAppDataPath(): String;
|
function GetAppDataPath(): String;
|
||||||
var
|
var
|
||||||
@ -122,7 +124,11 @@ end;
|
|||||||
|
|
||||||
function IsValidFileChar(const AChar: Char): Boolean;
|
function IsValidFileChar(const AChar: Char): Boolean;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF DXE2PLUS}
|
||||||
|
Result := not CharInSet(AChar, ['\', '/', ':', '*', '?', '"', '<', '>', '|']);
|
||||||
|
{$ELSE}
|
||||||
Result := not (AChar in ['\', '/', ':', '*', '?', '"', '<', '>', '|']);
|
Result := not (AChar in ['\', '/', ':', '*', '?', '"', '<', '>', '|']);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user