tvplanit: Fix crash when a DayView/WeekView/MonthView/GanttView is dropped on an empty form.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8552 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-10-13 14:43:54 +00:00
parent 26581143a8
commit b7c534c59a
5 changed files with 5 additions and 1 deletions

View File

@ -1009,13 +1009,13 @@ end;
function TVpDayView.IsHoliday(ADate: TDate; out AHolidayName: String): Boolean;
begin
if Assigned(FOnHoliday) then
AHolidayName := '';
if Assigned(FOnHoliday) then
begin
FOnHoliday(Self, trunc(ADate), AHolidayName);
Result := AHolidayName <> '';
end else
if Assigned(FControlLink) then
Result := FControlLink.IsHoliday(ADate, AHolidayName);
end;

View File

@ -1284,6 +1284,7 @@ begin
FOnHoliday(Self, ADate, AHolidayName);
Result := AHolidayName <> '';
end else
if Assigned(FControlLink) then
Result := FControlLink.IsHoliday(ADate, AHolidayName);
end;

View File

@ -626,6 +626,7 @@ begin
FOnHoliday(Self, ADate, AHolidayName);
Result := AHolidayName <> '';
end else
if Assigned(FControlLink) then
Result := FControlLink.IsHoliday(ADate, AHolidayName);
end;

View File

@ -785,6 +785,7 @@ begin
FOnHoliday(Self, ADate, AHolidayName);
Result := AHolidayName <> '';
end else
if Assigned(FControlLink) then
Result := FControlLink.IsHoliday(ADate, AHolidayName);
end;