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