|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[791]
trunk/Source/Core/InstantPersistence.pas
From: <and...@us...> - 2008-09-26 15:57:32
|
Revision: 791
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=791&view=rev
Author: andreavaccari
Date: 2008-09-26 15:57:21 +0000 (Fri, 26 Sep 2008)
Log Message:
-----------
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2008-09-05 09:11:38 UTC (rev 790)
+++ trunk/Source/Core/InstantPersistence.pas 2008-09-26 15:57:21 UTC (rev 791)
@@ -7197,6 +7197,9 @@
var
ANode, Delete, Child: TInstantCacheNode;
begin
+ if ANode = Leaf then
+ Exit;
+
ANode := FindNode(AObject.PersistentId);
if (ANode.Left = Leaf) or (ANode.Right = Leaf) then
Delete := ANode
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[792]
trunk/Source/Core/InstantPersistence.pas
From: <and...@us...> - 2008-11-20 09:43:52
|
Revision: 792
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=792&view=rev
Author: andreavaccari
Date: 2008-11-20 09:43:47 +0000 (Thu, 20 Nov 2008)
Log Message:
-----------
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2008-09-26 15:57:21 UTC (rev 791)
+++ trunk/Source/Core/InstantPersistence.pas 2008-11-20 09:43:47 UTC (rev 792)
@@ -7197,10 +7197,10 @@
var
ANode, Delete, Child: TInstantCacheNode;
begin
+ ANode := FindNode(AObject.PersistentId);
if ANode = Leaf then
Exit;
- ANode := FindNode(AObject.PersistentId);
if (ANode.Left = Leaf) or (ANode.Right = Leaf) then
Delete := ANode
else
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[871]
trunk/Source/Core/InstantPersistence.pas
From: <dav...@us...> - 2009-09-04 01:43:10
|
Revision: 871
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=871&view=rev
Author: davidvtaylor
Date: 2009-09-04 01:42:48 +0000 (Fri, 04 Sep 2009)
Log Message:
-----------
* Changed the new Bytes property of TInstantBlob from published to public for D5 compatibility
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2009-09-03 09:13:11 UTC (rev 870)
+++ trunk/Source/Core/InstantPersistence.pas 2009-09-04 01:42:48 UTC (rev 871)
@@ -472,9 +472,9 @@
procedure Reset; override;
procedure SaveDataToStream(AStream: TStream);
function WriteBuffer(const Buffer; Position, Count: Integer): Integer;
+ property Bytes: TInstantBytes read GetBytes write SetBytes;
property Size: Integer read GetSize;
published
- property Bytes: TInstantBytes read GetBytes write SetBytes;
property Value: string read GetValue write SetValue;
end;
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[888]
trunk/Source/Core/InstantPersistence.pas
From: <dav...@us...> - 2010-01-03 03:39:41
|
Revision: 888
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=888&view=rev
Author: davidvtaylor
Date: 2010-01-03 03:39:29 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
* Fix for compile breakage under D2010 caused by a parameter type mismatch in TInstantAttribute.Initialize. This change is only a quick fix. A more complete design review should be performed.
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2010-01-03 03:34:13 UTC (rev 887)
+++ trunk/Source/Core/InstantPersistence.pas 2010-01-03 03:39:29 UTC (rev 888)
@@ -2453,7 +2453,7 @@
begin
for CustomAttribute in RttiMember.GetAttributes do
if CustomAttribute is TInstantRttiAttribute then
- TInstantRttiAttribute(CustomAttribute).Change(Self, RttiMember);
+ TInstantRttiAttribute(CustomAttribute).Change(Self.GetOwner, RttiMember);
end;
var
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[898]
trunk/Source/Core/InstantPersistence.pas
From: <na...@us...> - 2010-07-12 11:25:49
|
Revision: 898
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=898&view=rev
Author: nandod
Date: 2010-07-12 11:25:42 +0000 (Mon, 12 Jul 2010)
Log Message:
-----------
* Fixed AV when loading large files in blob attributes. Reversed wrong change made in #830.
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2010-04-18 05:35:40 UTC (rev 897)
+++ trunk/Source/Core/InstantPersistence.pas 2010-07-12 11:25:42 UTC (rev 898)
@@ -3645,7 +3645,6 @@
function TInstantBlob.Write(const Buffer; Position, Count: Integer): Integer;
var
LValue: AnsiString;
- LBufferPointer: {$IFDEF D12+}PByte{$ELSE}PChar{$ENDIF};
function CompareBuffers: Boolean;
var
@@ -3653,7 +3652,7 @@
B: {$IFDEF D12+}Byte{$ELSE}Char{$ENDIF};
begin
Stream.Position := Position;
- for I := Position to Pred(Position + Count) do
+ for I := 0 to Pred(Count) do
begin
Result := (Stream.Read(B, 1) = 1) and (B = {$IFDEF D12+}PByte{$ELSE}PChar{$ENDIF}(@Buffer)[I]);
if not Result then
@@ -3663,11 +3662,10 @@
end;
begin
- SetLength(LValue, Count);
- LBufferPointer := @Buffer;
- Inc(LBufferPointer, Position);
- StrLCopy(PAnsiChar(LValue), PAnsiChar(LBufferPointer), Count);
+ SetLength(LValue, Count + 1);
+ StrLCopy(PAnsiChar(LValue), PAnsiChar(@Buffer), Count);
Validate(string(LValue));
+
if not CompareBuffers then
begin
Stream.Position := Position;
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[908]
trunk/Source/Core/InstantPersistence.pas
From: <na...@us...> - 2010-09-12 06:24:27
|
Revision: 908
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=908&view=rev
Author: nandod
Date: 2010-09-12 06:24:21 +0000 (Sun, 12 Sep 2010)
Log Message:
-----------
* Blob attribute are now considered null if they're empty. Fixes a param mapping problem in SQL resolvers.
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2010-09-12 06:21:39 UTC (rev 907)
+++ trunk/Source/Core/InstantPersistence.pas 2010-09-12 06:24:21 UTC (rev 908)
@@ -461,6 +461,7 @@
function Write(const Buffer; Position, Count: Integer): Integer; virtual;
procedure WriteObject(Writer: TInstantWriter); override;
procedure AssignTo(Dest: TPersistent); override;
+ function GetIsNull: Boolean; override;
public
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
@@ -3518,6 +3519,11 @@
Read(Result[0], 0, Size);
end;
+function TInstantBlob.GetIsNull: Boolean;
+begin
+ Result := Size = 0;
+end;
+
function TInstantBlob.GetSize: Integer;
begin
Result := Stream.Size;
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[931]
trunk/Source/Core/InstantPersistence.pas
From: <na...@us...> - 2010-10-11 14:08:15
|
Revision: 931
http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=931&view=rev
Author: nandod
Date: 2010-10-11 14:08:09 +0000 (Mon, 11 Oct 2010)
Log Message:
-----------
+ OnBeforeDispose event.
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2010-10-04 13:23:21 UTC (rev 930)
+++ trunk/Source/Core/InstantPersistence.pas 2010-10-11 14:08:09 UTC (rev 931)
@@ -785,6 +785,7 @@
FOnBeforeContentChange: TInstantContentChangeEvent;
FOnChange: TInstantNotifyEvent;
FOnError: TInstantErrorEvent;
+ FOnBeforeDispose: TInstantNotifyEvent;
procedure ClearOwnerContext;
procedure CreateAttributes;
procedure DestroyAttributes;
@@ -972,6 +973,8 @@
property RefBy[Index: Integer]: TInstantComplex read GetRefBy;
property RefByCount: Integer read GetRefByCount;
property UpdateCount: Integer read GetUpdateCount;
+ property OnBeforeDispose: TInstantNotifyEvent
+ read FOnBeforeDispose write FOnBeforeDispose;
property OnAfterContentChange: TInstantContentChangeEvent
read FOnAfterContentChange write FOnAfterContentChange;
property OnAttributeChanged: TInstantAttributeChangeEvent
@@ -5978,6 +5981,8 @@
procedure TInstantObject.DoBeforeDispose;
begin
BeforeDispose;
+ if Assigned(FOnBeforeDispose) then
+ FOnBeforeDispose(Self);
end;
procedure TInstantObject.DoBeforeRefresh;
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[967]
trunk/Source/Core/InstantPersistence.pas
From: <car...@us...> - 2014-11-26 10:20:26
|
Revision: 967
http://sourceforge.net/p/instantobjects/code/967
Author: carlobar
Date: 2014-11-26 10:20:23 +0000 (Wed, 26 Nov 2014)
Log Message:
-----------
Fixed problems when UseUnicode is active and streaming memo fields passing thorought Value of an InstantBlob attribute.
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2014-09-03 07:36:40 UTC (rev 966)
+++ trunk/Source/Core/InstantPersistence.pas 2014-11-26 10:20:23 UTC (rev 967)
@@ -485,6 +485,7 @@
TInstantMemo = class(TInstantBlob)
protected
class function AttributeType: TInstantAttributeType; override;
+ procedure SetValue(const AValue: string); override;
procedure ReadObject(Reader: TInstantReader); override;
procedure WriteObject(Writer: TInstantWriter); override;
end;
@@ -3724,23 +3725,13 @@
LAnsiValue: AnsiString;
LValue: String;
begin
- if not UseUnicode then
- begin
- LAnsiValue := AnsiString(AValue);
- L := Length(LAnsiValue) * SizeOf(AnsiChar);
- end
- else
- begin
- LValue := AValue;
- L := Length(LValue) * SizeOf(Char);
- end;
+ //Default Blob streaming is not based on UseUnicode setting.
+ LAnsiValue := AnsiString(AValue);
+ L := Length(LAnsiValue) * SizeOf(AnsiChar);
if L > 0 then
begin
Stream.Clear;
- if not UseUnicode then
- WriteBuffer(LAnsiValue[1], 0, L)
- else
- WriteBuffer(LValue[1], 0, L);
+ WriteBuffer(LAnsiValue[1], 0, L);
Stream.Size := L;
end
else
@@ -3906,6 +3897,36 @@
Value := Reader.ReadString;
end;
+procedure TInstantMemo.SetValue(const AValue: string);
+var
+ L: Integer;
+ LAnsiValue: AnsiString;
+ LValue: String;
+begin
+ //Don't call inherited: Text streaming is different by UseUnicode
+ if not UseUnicode then
+ begin
+ LAnsiValue := AnsiString(AValue);
+ L := Length(LAnsiValue) * SizeOf(AnsiChar);
+ end
+ else
+ begin
+ LValue := AValue;
+ L := Length(LValue) * SizeOf(Char);
+ end;
+ if L > 0 then
+ begin
+ Stream.Clear;
+ if not UseUnicode then
+ WriteBuffer(LAnsiValue[1], 0, L)
+ else
+ WriteBuffer(LValue[1], 0, L);
+ Stream.Size := L;
+ end
+ else
+ Clear;
+end;
+
procedure TInstantMemo.WriteObject(Writer: TInstantWriter);
begin
WriteName(Writer);
@@ -6088,7 +6109,8 @@
AttributeChanged(Attribute);
if Assigned(FOnAttributeChanged) then
FOnAttributeChanged(Self, Attribute);
- Changed;
+ if not ((Attribute is TInstantContainer) and TInstantContainer(Attribute).isVirtual) then
+ Changed;
end;
procedure TInstantObject.DoBeforeContentChange(
|
|
[Instantobjects-cvscommit] SF.net SVN: instantobjects:[979]
trunk/Source/Core/InstantPersistence.pas
From: <car...@us...> - 2017-04-04 14:00:06
|
Revision: 979
http://sourceforge.net/p/instantobjects/code/979
Author: carlobar
Date: 2017-04-04 14:00:04 +0000 (Tue, 04 Apr 2017)
Log Message:
-----------
Fixed xml encoding for object's Id into containers.
Modified Paths:
--------------
trunk/Source/Core/InstantPersistence.pas
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2017-03-16 08:57:46 UTC (rev 978)
+++ trunk/Source/Core/InstantPersistence.pas 2017-04-04 14:00:04 UTC (rev 979)
@@ -5489,7 +5489,7 @@
begin
InstantXMLProducer.WriteStartTag(
ObjectReferenceList.RefItems[I].ObjectClassName);
- InstantXMLProducer.WriteData(ObjectReferenceList.RefItems[I].ObjectId);
+ InstantXMLProducer.WriteEscapedData(ObjectReferenceList.RefItems[I].ObjectId);
InstantXMLProducer.WriteEndTag;
end;
InstantXMLProducer.WriteEndTag;
|