raw_interface.patch (2,544 bytes)
diff --git a/rtl/objpas/classes/reader.inc b/rtl/objpas/classes/reader.inc
index 60fec9244b..1dd916231b 100644
--- a/rtl/objpas/classes/reader.inc
+++ b/rtl/objpas/classes/reader.inc
@@ -715,6 +715,8 @@ Var
C : TComponent;
P : integer;
L : TLinkedList;
+ RI: Pointer; // raw interface
+ IIDStr: ShortString;
begin
If Assigned(FFixups) then
@@ -731,6 +733,16 @@ begin
If Assigned(C) then
if R.FPropInfo^.PropType^.Kind = tkInterface then
SetInterfaceProp(R.FInstance,R.FPropInfo,C)
+ else if R.FPropInfo^.PropType^.Kind = tkInterfaceRaw then
+ begin
+ IIDStr := GetTypeData(R.FPropInfo^.PropType)^.IIDStr;
+ if IIDStr = '' then
+ raise EReadError.CreateFmt(SInterfaceNoIIDStr, [R.FPropInfo^.PropType^.Name]);
+ if C.GetInterface(IIDStr, RI) then
+ SetRawInterfaceProp(R.FInstance,R.FPropInfo,RI)
+ else
+ raise EReadError.CreateFmt(SComponentDoesntImplement, [C.ClassName, IIDStr]);
+ end
else
SetObjectProp(R.FInstance,R.FPropInfo,C)
else
@@ -1397,7 +1409,7 @@ begin
begin
SetVariantProp(Instance,PropInfo,ReadVariant);
end;
- tkClass, tkInterface:
+ tkClass, tkInterface, tkInterfaceRaw:
case FDriver.NextValue of
vaNil:
begin
diff --git a/rtl/objpas/rtlconst.inc b/rtl/objpas/rtlconst.inc
index 30c09f694c..9132b16550 100644
--- a/rtl/objpas/rtlconst.inc
+++ b/rtl/objpas/rtlconst.inc
@@ -70,6 +70,7 @@ ResourceString
SCmplxUnexpectedEOS = 'Unexpected end of string [%s]';
SColorPrefix = 'Color';
SColorTags = 'ABCDEFGHIJKLMNOP';
+ SComponentDoesntImplement = 'Component "%s" does not implement "%s"';
SComponentNameTooLong = 'Component name "%s" exceeds 64 character limit';
SConfirmCreateDir = 'The selected directory does not exist. Should it be created?';
SControlParentSetToSelf = 'A component can not have itself as parent';
@@ -142,6 +143,7 @@ ResourceString
SParamIsNil = 'Parameter %s cannot be nil';
SIniFileWriteError = 'Unable to write to "%s"';
SInsertLineError = 'Line could not be inserted';
+ SInterfaceNoIIDStr = 'Interface "%s" does not have an IIDStr';
SInvalidActionCreation = 'Invalid action creation';
SInvalidActionEnumeration = 'Invalid action enumeration';
SInvalidActionRegistration = 'Invalid action registration';