Skip to content

Commit

Permalink
I think there must be wxwidgets function IsEmpty() instead of double …
Browse files Browse the repository at this point in the history
…negation,

because type of the variable is wxstring. Also I added the Trim() function before
check if function definition is empty or not.
  • Loading branch information
olshevskiy87 authored and Andrej Antonov (impulsm.work) committed Dec 14, 2015
1 parent b232fb8 commit 60d3823
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pgadmin/schema/pgFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,10 @@ wxString pgFunction::GetSql(ctlTree *browser)
sql = wxT("-- Function: ") + qtSig + wxT("\n\n")
+ wxT("-- DROP FUNCTION ") + qtSig + wxT(";\n\n");

if (!!GetFunctionDefByPg())
wxString functionDefByPgTrim = GetFunctionDefByPg().Trim();
if (!functionDefByPgTrim.IsEmpty())
{
sql += GetFunctionDefByPg().Trim();
sql += functionDefByPgTrim;
}
else if (GetLanguage() == wxT("edbspl") && GetProcType() == 2)
{
Expand Down Expand Up @@ -961,7 +962,7 @@ pgFunction *pgFunctionFactory::AppendFunctions(pgObject *obj, pgSchema *schema,
function->iSetReturnAsSet(functions->GetBool(wxT("proretset")));
function->iSetIsStrict(functions->GetBool(wxT("proisstrict")));
function->iSetSource(functions->GetVal(wxT("prosrc")));
if (!!functionDefByPgSelect)
if (!functionDefByPgSelect.IsEmpty())
{
function->iSetFunctionDefByPg(functions->GetVal(wxT("function_def_by_pg")));
}
Expand Down

0 comments on commit 60d3823

Please sign in to comment.