|
From: <sr...@us...> - 2007-02-01 03:39:42
|
Revision: 756
http://svn.sourceforge.net/instantobjects/revision/?rev=756&view=rev
Author: srmitch
Date: 2007-01-31 19:39:40 -0800 (Wed, 31 Jan 2007)
Log Message:
-----------
D5 compatibility fixes:
- The recent additions for TInstantDate and TInstantTime have broken IO
for Delphi 5. The problem arises because the 'DateUtils.pas' unit was not introduced until D6 so we need alternative support for the 'DateOf' and 'TimeOf' functions used in the 'InstantPersistence.pas' and 'InstantBrokers.pas' units.
- The recent fix to prevent duplicate attribute names has broken IO for Delphi 5. The main problem is that there is no 'IInterface'. 'IInterface' was not introduced until D6.
Modified Paths:
--------------
trunk/Source/Core/InstantBrokers.pas
trunk/Source/Core/InstantPersistence.pas
trunk/Source/Core/InstantTypes.pas
trunk/Source/Core/InstantUtils.pas
trunk/Source/Design/InstantAttributeEditor.pas
Modified: trunk/Source/Core/InstantBrokers.pas
===================================================================
--- trunk/Source/Core/InstantBrokers.pas 2007-01-22 12:50:17 UTC (rev 755)
+++ trunk/Source/Core/InstantBrokers.pas 2007-02-01 03:39:40 UTC (rev 756)
@@ -981,8 +981,8 @@
{$ENDIF}
{$IFDEF D6+}
Variants,
+ DateUtils,
{$ENDIF}
- DateUtils,
TypInfo, InstantUtils, InstantRtti;
const
Modified: trunk/Source/Core/InstantPersistence.pas
===================================================================
--- trunk/Source/Core/InstantPersistence.pas 2007-01-22 12:50:17 UTC (rev 755)
+++ trunk/Source/Core/InstantPersistence.pas 2007-02-01 03:39:40 UTC (rev 756)
@@ -1596,10 +1596,10 @@
{$IFDEF D6+}
MaskUtils,
Variants,
+ DateUtils,
{$ELSE}
Mask,
{$ENDIF}
- DateUtils,
InstantUtils, {InstantRtti, }InstantDesignHook, InstantCode;
var
Modified: trunk/Source/Core/InstantTypes.pas
===================================================================
--- trunk/Source/Core/InstantTypes.pas 2007-01-22 12:50:17 UTC (rev 755)
+++ trunk/Source/Core/InstantTypes.pas 2007-02-01 03:39:40 UTC (rev 756)
@@ -41,6 +41,11 @@
interface
type
+ {$IFNDEF D6+}
+ IInterface = interface (IUnknown)
+ end;
+ {$ENDIF}
+
TInstantStorageKind = (skEmbedded, skExternal);
TInstantAttributeType = (atUnknown, atInteger, atFloat, atCurrency, atBoolean,
atString, atDateTime, atBlob, atMemo, atGraphic,
Modified: trunk/Source/Core/InstantUtils.pas
===================================================================
--- trunk/Source/Core/InstantUtils.pas 2007-01-22 12:50:17 UTC (rev 755)
+++ trunk/Source/Core/InstantUtils.pas 2007-02-01 03:39:40 UTC (rev 756)
@@ -87,6 +87,11 @@
function InstantStrToTime(const Str: string): TDateTime;
function InstantUnquote(const Str: string; Quote: Char): string;
+{$IFDEF D5}
+function DateOf(const AValue: TDateTime): TDateTime;
+function TimeOf(const AValue: TDateTime): TDateTime;
+{$ENDIF}
+
implementation
uses
@@ -603,4 +608,16 @@
Result := AnsiExtractQuotedStr(S, Quote);
end;
+{$IFDEF D5}
+function DateOf(const AValue: TDateTime): TDateTime;
+begin
+ Result := Trunc(AValue);
+end;
+
+function TimeOf(const AValue: TDateTime): TDateTime;
+begin
+ Result := Frac(AValue);
+end;
+{$ENDIF}
+
end.
Modified: trunk/Source/Design/InstantAttributeEditor.pas
===================================================================
--- trunk/Source/Design/InstantAttributeEditor.pas 2007-01-22 12:50:17 UTC (rev 755)
+++ trunk/Source/Design/InstantAttributeEditor.pas 2007-02-01 03:39:40 UTC (rev 756)
@@ -48,7 +48,7 @@
{$IFDEF LINUX}
QImgList, QStdCtrls, QDBCtrls, QMask, QControls, QComCtrls, QExtCtrls,
{$ENDIF}
- InstantPresentation;
+ InstantPresentation, InstantTypes;
type
TInstantStringsEvent = procedure(Sender: TObject; Items: TStrings;
@@ -175,7 +175,7 @@
uses
InstantRtti, InstantPersistence, InstantDesignUtils, InstantImageUtils,
- InstantClasses, InstantMetadata, InstantTypes;
+ InstantClasses, InstantMetadata;
{$R *.dfm}
|