Просмотр исходного кода

* Merged bugfixes from the main branch and added other small fixes

sg 25 лет назад
Родитель
Сommit
3dd45c7c35
4 измененных файлов с 55 добавлено и 15 удалено
  1. 14 3
      fcl/inc/constse.inc
  2. 14 3
      fcl/inc/constsg.inc
  3. 14 3
      fcl/inc/constss.inc
  4. 13 6
      fcl/inc/reader.inc

+ 14 - 3
fcl/inc/constse.inc

@@ -41,6 +41,7 @@ const
   SInvalidPropertyPath = 'Invalid property path';
   SInvalidPropertyPath = 'Invalid property path';
   SUnknownProperty = 'Unknown property';
   SUnknownProperty = 'Unknown property';
   SReadOnlyProperty = 'Read-only property';
   SReadOnlyProperty = 'Read-only property';
+  SUnknownPropertyType = 'Unknown property type %d';
   SPropertyException = 'Error while reading %s%s%s: %s';
   SPropertyException = 'Error while reading %s%s%s: %s';
   SAncestorNotFound = 'Ancestor of ''%s'' not found';
   SAncestorNotFound = 'Ancestor of ''%s'' not found';
   SInvalidBitmap = 'Invalid Bitmap';
   SInvalidBitmap = 'Invalid Bitmap';
@@ -272,7 +273,17 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:59  michael
-  + removed logs
- 
+  Revision 1.1.2.1  2001-01-10 16:59:38  sg
+  * Merged bugfixes from the main branch and added other small fixes
+
+  Revision 1.1  2000/07/13 06:31:30  michael
+  + Initial import
+
+  Revision 1.9  2000/06/29 16:29:23  sg
+  * Implemented streaming. Note: The writer driver interface is stable, but
+    the reader interface is not final yet!
+
+  Revision 1.8  2000/02/15 21:57:51  sg
+  * Added copyright notice and CVS log tags where necessary
+
 }
 }

+ 14 - 3
fcl/inc/constsg.inc

@@ -42,6 +42,7 @@ const
   SInvalidPropertyPath = 'Ungültiger Pfad für Eigenschaft';
   SInvalidPropertyPath = 'Ungültiger Pfad für Eigenschaft';
   SUnknownProperty = 'Eigenschaft existiert nicht';
   SUnknownProperty = 'Eigenschaft existiert nicht';
   SReadOnlyProperty = 'Eigenschaft kann nur gelesen werden';
   SReadOnlyProperty = 'Eigenschaft kann nur gelesen werden';
+  SUnknownPropertyType = 'Unbekannter Eigenschaftstyp %d';
   SPropertyException = 'Fehler beim Lesen von %s%s: %s';
   SPropertyException = 'Fehler beim Lesen von %s%s: %s';
   SAncestorNotFound = 'Vorfahr für ''%s'' nicht gefunden';
   SAncestorNotFound = 'Vorfahr für ''%s'' nicht gefunden';
   SInvalidBitmap = 'Bitmap ist ungültig';
   SInvalidBitmap = 'Bitmap ist ungültig';
@@ -273,7 +274,17 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:59  michael
-  + removed logs
- 
+  Revision 1.1.2.1  2001-01-10 16:59:38  sg
+  * Merged bugfixes from the main branch and added other small fixes
+
+  Revision 1.1  2000/07/13 06:31:30  michael
+  + Initial import
+
+  Revision 1.7  2000/06/29 16:29:23  sg
+  * Implemented streaming. Note: The writer driver interface is stable, but
+    the reader interface is not final yet!
+
+  Revision 1.6  2000/02/15 21:57:51  sg
+  * Added copyright notice and CVS log tags where necessary
+
 }
 }

+ 14 - 3
fcl/inc/constss.inc

@@ -41,6 +41,7 @@ const
   SInvalidPropertyPath = 'Path de propiedad no valido';
   SInvalidPropertyPath = 'Path de propiedad no valido';
   SUnknownProperty = 'Propiedad desconocidad';
   SUnknownProperty = 'Propiedad desconocidad';
   SReadOnlyProperty = 'Propiedad de solo lectura';
   SReadOnlyProperty = 'Propiedad de solo lectura';
+{N}  SUnknownPropertyType = 'Unknown property type %d';
   SPropertyException = 'Error leyendo %s%s: %s';
   SPropertyException = 'Error leyendo %s%s: %s';
 {N}  SAncestorNotFound = 'Ancestor of ''%s'' not found.';
 {N}  SAncestorNotFound = 'Ancestor of ''%s'' not found.';
   SInvalidBitmap = 'Bitmap no valido';
   SInvalidBitmap = 'Bitmap no valido';
@@ -272,7 +273,17 @@ const
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:59  michael
-  + removed logs
- 
+  Revision 1.1.2.1  2001-01-10 16:59:38  sg
+  * Merged bugfixes from the main branch and added other small fixes
+
+  Revision 1.1  2000/07/13 06:31:30  michael
+  + Initial import
+
+  Revision 1.7  2000/06/29 16:29:23  sg
+  * Implemented streaming. Note: The writer driver interface is stable, but
+    the reader interface is not final yet!
+
+  Revision 1.6  2000/02/15 21:57:51  sg
+  * Added copyright notice and CVS log tags where necessary
+
 }
 }

+ 13 - 6
fcl/inc/reader.inc

@@ -25,7 +25,7 @@ end;
 
 
 destructor TBinaryObjectReader.Destroy;
 destructor TBinaryObjectReader.Destroy;
 begin
 begin
-  { Seek back the amount of bytes that we didn't process unitl now: }
+  { Seek back the amount of bytes that we didn't process until now: }
   FStream.Seek(Integer(FBufPos) - Integer(FBufEnd), soFromCurrent);
   FStream.Seek(Integer(FBufPos) - Integer(FBufEnd), soFromCurrent);
 
 
   if Assigned(FBuffer) then
   if Assigned(FBuffer) then
@@ -709,12 +709,11 @@ begin
             FOnCreateComponent(Self, ComponentClass, Result);
             FOnCreateComponent(Self, ComponentClass, Result);
           if not Assigned(Result) then
           if not Assigned(Result) then
           begin
           begin
-//!!!:            NewComponent := TComponent(ComponentClass.NewInstance);
-	    NewComponent := TComponentClass(ComponentClass).Create(Owner);
+            NewComponent := TComponent(ComponentClass.NewInstance);
             if ffInline in Flags then
             if ffInline in Flags then
 	      NewComponent.FComponentState :=
 	      NewComponent.FComponentState :=
 	        NewComponent.FComponentState + [csLoading, csInline];
 	        NewComponent.FComponentState + [csLoading, csInline];
-//!!!:            NewComponent.Create(Owner);
+            NewComponent.Create(Owner);
 
 
 	    { Don't set Result earlier because else we would come in trouble
 	    { Don't set Result earlier because else we would come in trouble
 	      with the exception recover mechanism! (Result should be NIL if
 	      with the exception recover mechanism! (Result should be NIL if
@@ -928,6 +927,7 @@ begin
 	  FPropName := DotPos;
 	  FPropName := DotPos;
 	  break;
 	  break;
 	end;
 	end;
+	DotPos := NextPos + 1;
 
 
         PropInfo := GetPropInfo(Instance.ClassInfo, FPropName);
         PropInfo := GetPropInfo(Instance.ClassInfo, FPropName);
         if not Assigned(PropInfo) then
         if not Assigned(PropInfo) then
@@ -1003,6 +1003,8 @@ begin
           raise EReadError.Create(SInvalidPropertyValue);
           raise EReadError.Create(SInvalidPropertyValue);
       end else
       end else
         SetOrdProp(Instance, PropInfo, ReadInteger);
         SetOrdProp(Instance, PropInfo, ReadInteger);
+    tkBool:
+      SetOrdProp(Instance, PropInfo, Ord(ReadBoolean));
     tkChar:
     tkChar:
       SetOrdProp(Instance, PropInfo, Ord(ReadChar));
       SetOrdProp(Instance, PropInfo, Ord(ReadChar));
     tkEnumeration:
     tkEnumeration:
@@ -1051,6 +1053,8 @@ begin
           FFixups.Add(TPropFixup.Create(Instance, Root, PropInfo, '', ReadIdent));
           FFixups.Add(TPropFixup.Create(Instance, Root, PropInfo, '', ReadIdent));
       end;
       end;
     tkInt64: SetInt64Prop(Instance, PropInfo, ReadInt64);
     tkInt64: SetInt64Prop(Instance, PropInfo, ReadInt64);
+    else
+      raise EReadError.CreateFmt(SUnknownPropertyType, [Ord(PropType^.Kind)]);
   end;
   end;
 end;
 end;
 
 
@@ -1092,7 +1096,7 @@ begin
               Inc(i);
               Inc(i);
               ResultName := CompName + '_' + IntToStr(i);
               ResultName := CompName + '_' + IntToStr(i);
             end;
             end;
-	    ResultName := Result.Name;
+	    Result.Name := ResultName;
           end else
           end else
             Result.Name := '';
             Result.Name := '';
         end;
         end;
@@ -1263,7 +1267,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.1.2.1  2000-12-20 23:11:25  sg
+  Revision 1.1.2.2  2001-01-10 16:59:38  sg
+  * Merged bugfixes from the main branch and added other small fixes
+
+  Revision 1.1.2.1  2000/12/20 23:11:25  sg
   * Applied bugfixes by Mattias Gaertner for TBinaryObjectReader.ReadSet
   * Applied bugfixes by Mattias Gaertner for TBinaryObjectReader.ReadSet
     (uninitialized result and missing bit shifting) and
     (uninitialized result and missing bit shifting) and
     TReader.ReadRootComponent (finding an unique component name)
     TReader.ReadRootComponent (finding an unique component name)