Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
Fix a crash that could occur if viewing a table with no rows in the E…
Browse files Browse the repository at this point in the history
…dit Grid [Ashesh Vashi].

git-svn-id: svn://svn.pgadmin.org/trunk@8300 a7884b65-44f6-0310-8a51-81a127f17b15
  • Loading branch information
dpage committed Apr 27, 2010
1 parent cea3476 commit 8d7ea2f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Changes

Date Dev Ver Change details
---------- --- ------ --------------
2010-04-27 DP 1.10.3 Fix a crash that could occur if viewing a table with
no rows in the Edit Grid [Ashesh Vashi].
2010-04-26 DP 1.10.3 Fix a crash occuring when a function with a parameter
with a default is selected [Ashesh Vashi].
2010-04-24 GL 1.12.0 Added support for servers's groups.
Expand Down
16 changes: 16 additions & 0 deletions pgadmin/frm/frmEditGrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@ void frmEditGrid::OnIncludeFilter(wxCommandEvent &event)
int curcol=sqlGrid->GetGridCursorCol();
int currow=sqlGrid->GetGridCursorRow();

if (curcol == -1 || currow == -1)
return;

sqlTable *table=sqlGrid->GetTable();
wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
wxString new_filter_string;
Expand Down Expand Up @@ -522,6 +525,9 @@ void frmEditGrid::OnExcludeFilter(wxCommandEvent &event)
{
int curcol=sqlGrid->GetGridCursorCol();
int currow=sqlGrid->GetGridCursorRow();

if (curcol == -1 || currow == -1)
return;

sqlTable *table=sqlGrid->GetTable();
wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
Expand Down Expand Up @@ -571,6 +577,9 @@ void frmEditGrid::OnAscSort(wxCommandEvent &ev)
{
int curcol=sqlGrid->GetGridCursorCol();

if (curcol == -1)
return;

sqlTable *table=sqlGrid->GetTable();
wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
wxString old_sort_string = GetSortCols().Trim();
Expand Down Expand Up @@ -608,6 +617,9 @@ void frmEditGrid::OnDescSort(wxCommandEvent &ev)
{
int curcol=sqlGrid->GetGridCursorCol();

if (curcol == -1)
return;

sqlTable *table=sqlGrid->GetTable();
wxString column_label = qtIdent(table->GetColLabelValueUnformatted(curcol));
wxString old_sort_string = GetSortCols().Trim();
Expand Down Expand Up @@ -761,6 +773,10 @@ void frmEditGrid::OnKey(wxKeyEvent &event)
{
int curcol=sqlGrid->GetGridCursorCol();
int currow=sqlGrid->GetGridCursorRow();

if (curcol == -1 || currow == -1)
return;

int keycode=event.GetKeyCode();
wxCommandEvent ev;

Expand Down

0 comments on commit 8d7ea2f

Please sign in to comment.