From: <na...@us...> - 2010-09-12 06:25:29
|
Revision: 909 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=909&view=rev Author: nandod Date: 2010-09-12 06:25:23 +0000 (Sun, 12 Sep 2010) Log Message: ----------- * Added code to handle two corner cases in presentation layer. Modified Paths: -------------- trunk/Source/Core/InstantPresentation.pas Modified: trunk/Source/Core/InstantPresentation.pas =================================================================== --- trunk/Source/Core/InstantPresentation.pas 2010-09-12 06:24:21 UTC (rev 908) +++ trunk/Source/Core/InstantPresentation.pas 2010-09-12 06:25:23 UTC (rev 909) @@ -2796,7 +2796,7 @@ Result := BM.Instance; end else if not InContent then Result := Subject - else if RecNo <= 0 then + else if (RecNo <= 0) or (RecordCount = 0) then Result := nil else Result := Objects[Pred(RecNo)]; @@ -3911,6 +3911,7 @@ var Buffer: TRecordBuffer; Editing: Boolean; + BrowsingObject: Boolean; begin if not Active then begin @@ -3928,8 +3929,8 @@ if Assigned(Buffer) then begin Editing := (Buffer = ActiveBuffer) and (State in dsEditModes); - Result := (State = dsBrowse) or - (Editing and (eoSyncEdit in Options)); + BrowsingObject := (State = dsBrowse) and (AObject is ObjectClass); + Result := BrowsingObject or (Editing and (eoSyncEdit in Options)); if Result then begin CopyObjectToBuffer(AObject, Buffer); |