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

View File

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

View File

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