RxDBGrid - fix call footer values for empty dataset

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2800 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2013-09-30 20:52:47 +00:00
parent 88eab3760e
commit 7ad7893a42
3 changed files with 35 additions and 9 deletions

View File

@ -42,7 +42,7 @@
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="21">
<Units Count="23">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
@ -59,11 +59,10 @@
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="0"/>
<WindowIndex Value="0"/>
<TopLine Value="6"/>
<CursorPos X="15" Y="19"/>
<CursorPos X="26" Y="13"/>
<UsageCount Value="20"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -79,7 +78,7 @@
<Unit3>
<Filename Value="../../tooledit.pas"/>
<UnitName Value="tooledit"/>
<EditorIndex Value="1"/>
<EditorIndex Value="3"/>
<WindowIndex Value="0"/>
<TopLine Value="794"/>
<CursorPos X="5" Y="797"/>
@ -194,13 +193,34 @@
<Unit20>
<Filename Value="../../../../lcl/editbtn.pas"/>
<UnitName Value="EditBtn"/>
<EditorIndex Value="2"/>
<EditorIndex Value="4"/>
<WindowIndex Value="0"/>
<TopLine Value="774"/>
<CursorPos X="1" Y="792"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit20>
<Unit21>
<Filename Value="../../../rxnet/registerrxnet.pas"/>
<UnitName Value="RegisterRxNet"/>
<IsVisibleTab Value="True"/>
<EditorIndex Value="1"/>
<WindowIndex Value="0"/>
<TopLine Value="1"/>
<CursorPos X="34" Y="19"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit21>
<Unit22>
<Filename Value="../../registerrxtools.pas"/>
<UnitName Value="RegisterRxTools"/>
<EditorIndex Value="2"/>
<WindowIndex Value="0"/>
<TopLine Value="22"/>
<CursorPos X="1" Y="48"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit22>
</Units>
<JumpHistory Count="21" HistoryIndex="20">
<Position1>

View File

@ -3838,8 +3838,7 @@ var
SaveBeforeScroll:TDataSetNotifyEvent;
RCol:TRxColumn;
begin
if (not (FFooterOptions.Active and DatalinkActive)) or (Columns.Count = 0) or
(DataSource.DataSet.RecordCount<=0) or (gsAddingAutoColumns in GridStatus) then
if (not (FFooterOptions.Active and DatalinkActive)) or (Columns.Count = 0) or (gsAddingAutoColumns in GridStatus) then
Exit;
//Дополнительно проверим - а стоит ли делать пробег по данным - есть ли агрегатные функции
APresent := False;
@ -3854,6 +3853,7 @@ begin
if not APresent then
exit;
Inc(FInProcessCalc);
(*
@ -3899,6 +3899,12 @@ begin
for i := 0 to Columns.Count - 1 do
TRxColumn(Columns[i]).Footer.ResetTestValue;
if (DataSource.DataSet.RecordCount<=0) then
begin
Dec(FInProcessCalc);
exit;
end;
DHL:=THackDataLink(Datalink);
DHS:=THackDataSet(DataSource.DataSet);
SaveState:=DHS.SetTempState(dsBrowse);

View File

@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="4">
<PathDelim Value="\"/>
@ -26,7 +26,7 @@ Copyright (c) 1998 Master-Bank
translate to Lazarus by alexs in 2005 - 2012
"/>
<License Value="LGPL"/>
<Version Major="2" Minor="5" Release="1" Build="134"/>
<Version Major="2" Minor="5" Release="2" Build="134"/>
<Files Count="68">
<Item1>
<Filename Value="autopanel.pas"/>