Prechádzať zdrojové kódy

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

sg 25 rokov pred
rodič
commit
3dd45c7c35
4 zmenil súbory, kde vykonal 55 pridanie a 15 odobranie
  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';
   SUnknownProperty = 'Unknown property';
   SReadOnlyProperty = 'Read-only property';
+  SUnknownPropertyType = 'Unknown property type %d';
   SPropertyException = 'Error while reading %s%s%s: %s';
   SAncestorNotFound = 'Ancestor of ''%s'' not found';
   SInvalidBitmap = 'Invalid Bitmap';
@@ -272,7 +273,17 @@ const
 
 {
   $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';
   SUnknownProperty = 'Eigenschaft existiert nicht';
   SReadOnlyProperty = 'Eigenschaft kann nur gelesen werden';
+  SUnknownPropertyType = 'Unbekannter Eigenschaftstyp %d';
   SPropertyException = 'Fehler beim Lesen von %s%s: %s';
   SAncestorNotFound = 'Vorfahr für ''%s'' nicht gefunden';
   SInvalidBitmap = 'Bitmap ist ungültig';
@@ -273,7 +274,17 @@ const
 
 {
   $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';
   SUnknownProperty = 'Propiedad desconocidad';
   SReadOnlyProperty = 'Propiedad de solo lectura';
+{N}  SUnknownPropertyType = 'Unknown property type %d';
   SPropertyException = 'Error leyendo %s%s: %s';
 {N}  SAncestorNotFound = 'Ancestor of ''%s'' not found.';
   SInvalidBitmap = 'Bitmap no valido';
@@ -272,7 +273,17 @@ const
 
 {
   $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;
 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);
 
   if Assigned(FBuffer) then
@@ -709,12 +709,11 @@ begin
             FOnCreateComponent(Self, ComponentClass, Result);
           if not Assigned(Result) then
           begin
-//!!!:            NewComponent := TComponent(ComponentClass.NewInstance);
-	    NewComponent := TComponentClass(ComponentClass).Create(Owner);
+            NewComponent := TComponent(ComponentClass.NewInstance);
             if ffInline in Flags then
 	      NewComponent.FComponentState :=
 	        NewComponent.FComponentState + [csLoading, csInline];
-//!!!:            NewComponent.Create(Owner);
+            NewComponent.Create(Owner);
 
 	    { Don't set Result earlier because else we would come in trouble
 	      with the exception recover mechanism! (Result should be NIL if
@@ -928,6 +927,7 @@ begin
 	  FPropName := DotPos;
 	  break;
 	end;
+	DotPos := NextPos + 1;
 
         PropInfo := GetPropInfo(Instance.ClassInfo, FPropName);
         if not Assigned(PropInfo) then
@@ -1003,6 +1003,8 @@ begin
           raise EReadError.Create(SInvalidPropertyValue);
       end else
         SetOrdProp(Instance, PropInfo, ReadInteger);
+    tkBool:
+      SetOrdProp(Instance, PropInfo, Ord(ReadBoolean));
     tkChar:
       SetOrdProp(Instance, PropInfo, Ord(ReadChar));
     tkEnumeration:
@@ -1051,6 +1053,8 @@ begin
           FFixups.Add(TPropFixup.Create(Instance, Root, PropInfo, '', ReadIdent));
       end;
     tkInt64: SetInt64Prop(Instance, PropInfo, ReadInt64);
+    else
+      raise EReadError.CreateFmt(SUnknownPropertyType, [Ord(PropType^.Kind)]);
   end;
 end;
 
@@ -1092,7 +1096,7 @@ begin
               Inc(i);
               ResultName := CompName + '_' + IntToStr(i);
             end;
-	    ResultName := Result.Name;
+	    Result.Name := ResultName;
           end else
             Result.Name := '';
         end;
@@ -1263,7 +1267,10 @@ end;
 
 {
   $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
     (uninitialized result and missing bit shifting) and
     TReader.ReadRootComponent (finding an unique component name)