tvplanit: Fix compilation with Laz 1.8.4. Avoid crashes of import methods if no resource has been created.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6508 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-06-18 20:01:53 +00:00
parent c2bdef7621
commit bab84c3523
10 changed files with 26 additions and 17 deletions

View File

@ -775,7 +775,6 @@ object MainForm: TMainForm
Tag = 0 Tag = 0
end> end>
Images = ImageList1 Images = ImageList1
ImagesWidth = 0
ItemFont.Color = clWhite ItemFont.Color = clWhite
SelectedItem = -1 SelectedItem = -1
SelectedItemFont.Color = clWhite SelectedItemFont.Color = clWhite

View File

@ -128,7 +128,6 @@ object Form1: TForm1
ContainerIndex = 0 ContainerIndex = 0
end> end>
Images = Images Images = Images
ImagesWidth = 0
ItemFont.Color = clWhite ItemFont.Color = clWhite
ItemSpacing = 5 ItemSpacing = 5
SelectedItem = -1 SelectedItem = -1

View File

@ -7,7 +7,7 @@ object Form1: TForm1
ClientHeight = 441 ClientHeight = 441
ClientWidth = 934 ClientWidth = 934
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '1.9.0.0' LCLVersion = '1.8.4.0'
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 42 Height = 42

View File

@ -64,7 +64,7 @@ begin
ControlLink := TVpControlLink.Create(self); ControlLink := TVpControlLink.Create(self);
ControlLink.Datastore := Datastore; ControlLink.Datastore := Datastore;
// This establishes the links to all controls that depend on Datastore. // This establishes the links to all controls that depend on Datastore.
// Must be called when all dependent controls are created. // Must be called when all dependent controls have been created.
if Datastore.Resources.Count > 0 then if Datastore.Resources.Count > 0 then
Datastore.Resource := Datastore.Resources.Items[0]; Datastore.Resource := Datastore.Resources.Items[0];

View File

@ -303,7 +303,7 @@ Contributor(s): "/>
</Item67> </Item67>
<Item68> <Item68>
<Filename Value="source\vpxmlds.pas"/> <Filename Value="source\vpxmlds.pas"/>
<UnitName Value="VpXmlDs"/> <UnitName Value="VpXmlDS"/>
</Item68> </Item68>
<Item69> <Item69>
<Filename Value="source\vpxparsr.pas"/> <Filename Value="source\vpxparsr.pas"/>
@ -319,11 +319,11 @@ Contributor(s): "/>
</Item71> </Item71>
<Item72> <Item72>
<Filename Value="source\vpvcard.pas"/> <Filename Value="source\vpvcard.pas"/>
<UnitName Value="vpvcard"/> <UnitName Value="VpVCard"/>
</Item72> </Item72>
<Item73> <Item73>
<Filename Value="source\vpbasedatafiles.pas"/> <Filename Value="source\vpbasedatafiles.pas"/>
<UnitName Value="vpbasedatafiles"/> <UnitName Value="VpBaseDataFiles"/>
</Item73> </Item73>
<Item74> <Item74>
<Filename Value="source\vpical.pas"/> <Filename Value="source\vpical.pas"/>

View File

@ -14,6 +14,7 @@
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)\zeos_design"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)\zeos_design"/>
</SearchPaths> </SearchPaths>
</CompilerOptions> </CompilerOptions>
<Description Value="Visual PlanIt datastore for ZEOS database components (Designtime package)"/>
<Version Major="1" Release="11"/> <Version Major="1" Release="11"/>
<Files Count="1"> <Files Count="1">
<Item1> <Item1>

View File

@ -1310,6 +1310,11 @@ var
id: Integer; id: Integer;
startTime, endTime: TDateTime; startTime, endTime: TDateTime;
begin begin
if ReadOnly or (not CheckCreateResource) or
(not Assigned(DataStore)) or (not Assigned(DataStore.Resource))
then
Exit;
dlg := TOpenDialog.Create(nil); dlg := TOpenDialog.Create(nil);
try try
dlg.Title := RSLoadICalTitle; dlg.Title := RSLoadICalTitle;

View File

@ -344,7 +344,9 @@ type
property DrawingStyle: TVpFolderDrawingStyle read FDrawingStyle write SetDrawingStyle; property DrawingStyle: TVpFolderDrawingStyle read FDrawingStyle write SetDrawingStyle;
property FolderCollection: TVpCollection read FFolders write FFolders; property FolderCollection: TVpCollection read FFolders write FFolders;
property Images: TImageList read FImages write SetImages; property Images: TImageList read FImages write SetImages;
property ImagesWidth: Integer read FImagesWidth write SetImagesWidth; {$IF LCL_FullVersion >= 1090000}
property ImagesWidth: Integer read FImagesWidth write SetImagesWidth default 0;
{$ENDIF}
property ItemFont: TFont read FItemFont write SetItemFont; property ItemFont: TFont read FItemFont write SetItemFont;
property ItemSpacing: Integer read FItemSpacing write SetItemSpacing stored IsStoredItemSpacing; property ItemSpacing: Integer read FItemSpacing write SetItemSpacing stored IsStoredItemSpacing;
property ItemTheme: TVpItemTheme read FItemTheme write FItemTheme default itNoTheme; property ItemTheme: TVpItemTheme read FItemTheme write FItemTheme default itNoTheme;

View File

@ -904,8 +904,10 @@ var
i: Integer; i: Integer;
id: Integer; id: Integer;
begin begin
if ReadOnly or (not CheckCreateResource) then if ReadOnly or (not CheckCreateResource) or
exit; (not Assigned(DataStore)) or (not Assigned(DataStore.Resource))
then
Exit;
dlg := TOpenDialog.Create(nil); dlg := TOpenDialog.Create(nil);
try try

View File

@ -1222,13 +1222,9 @@ var
StartTime: TDateTime; StartTime: TDateTime;
EndTime: TDateTime; EndTime: TDateTime;
begin begin
if ReadOnly then if ReadOnly or (not CheckCreateResource) or
Exit; (not Assigned(DataStore) ) or (not Assigned(DataStore.Resource))
if not CheckCreateResource then then
Exit;
if not Assigned(DataStore) then
Exit;
if not Assigned(DataStore.Resource) then
Exit; Exit;
StartTime := trunc(Date) + 1 / 2; { default to 12:00 noon } StartTime := trunc(Date) + 1 / 2; { default to 12:00 noon }
@ -1253,6 +1249,11 @@ var
id: Integer; id: Integer;
startTime, endTime: TDateTime; startTime, endTime: TDateTime;
begin begin
if ReadOnly or (not CheckCreateResource) or
(not Assigned(DataStore)) or (not Assigned(DataStore.Resource))
then
Exit;
dlg := TOpenDialog.Create(nil); dlg := TOpenDialog.Create(nil);
try try
dlg.Title := RSLoadICalTitle; dlg.Title := RSLoadICalTitle;