View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006195 | JEDI VCL | 00 JVCL Components | public | 2013-08-31 05:15 | 2014-12-04 16:32 |
Reporter | jdressler | Assigned To | obones | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | suspended | ||
Product Version | 3.47 | ||||
Target Version | Fixed in Version | ||||
Summary | 0006195: TJvDBUltimGrid Search without result causes access violation | ||||
Description | ============= Old routine, without calling SaveGridPosition(); ================ function TJvDBUltimGrid.Search(const ValueToSearch: Variant; var ResultCol: Integer; var ResultField: TField; const CaseSensitive, WholeFieldOnly, Focus: Boolean): Boolean; begin Result := False; if (SearchFields.Count > 0) and (ValueToSearch <> Null) and (ValueToSearch <> '') then begin FValueToSearch := ValueToSearch; Result := PrivateSearch(ResultCol, ResultField, CaseSensitive, WholeFieldOnly, False); if Result then begin Self.Col := ResultCol; if Focus and Self.Visible and Self.CanFocus then Self.SetFocus; end else RestoreGridPosition; end; end; ============= New Routine, fixed, with SaveGridPosition ====================== function TJvDBUltimGrid.Search(const ValueToSearch: Variant; var ResultCol: Integer; var ResultField: TField; const CaseSensitive, WholeFieldOnly, Focus: Boolean): Boolean; begin Result := False; if (SearchFields.Count > 0) and (ValueToSearch <> Null) and (ValueToSearch <> '') then begin FValueToSearch := ValueToSearch; SaveGridPosition(); Result := PrivateSearch(ResultCol, ResultField, CaseSensitive, WholeFieldOnly, False); if Result then begin Self.Col := ResultCol; if Focus and Self.Visible and Self.CanFocus then Self.SetFocus; end else RestoreGridPosition; end; end; | ||||
Additional Information | Also note it might be wise to add nil check to RestoreGridPosition() eg.'(FSavedBookmark<>nil) and' procedure TJvDBUltimGrid.RestoreGridPosition(Mode: TResyncMode = [rmExact, rmCenter]); begin if Assigned(FOnRestoreGridPosition) then begin if DataLink.DataSet.BookmarkValid(Pointer(FSavedBookmark)) then GotoBookmarkEx(DataLink.DataSet, Pointer(FSavedBookmark), [rmExact], False); DataLink.ActiveRecord := FSavedRowPos; FOnRestoreGridPosition(Self, Pointer(FSavedBookmark), FSavedRowPos); end else if (FSavedBookmark<>nil) and DataLink.DataSet.BookmarkValid(Pointer(FSavedBookmark)) then GotoBookmarkEx(DataLink.DataSet, Pointer(FSavedBookmark), Mode, False); end; | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2013-08-31 05:15 | jdressler | New Issue | |
2013-08-31 13:36 | Arioch | Note Added: 0020617 | |
2013-08-31 13:36 | Arioch | Status | new => feedback |
2013-12-13 11:45 | obones | Note Added: 0020800 | |
2014-12-04 16:32 | obones | Note Added: 0021116 | |
2014-12-04 16:32 | obones | Status | feedback => resolved |
2014-12-04 16:32 | obones | Resolution | open => suspended |
2014-12-04 16:32 | obones | Assigned To | => obones |