>From 22bb5f859aa4e324e63e9272532fd013cb02bc0f Mon Sep 17 00:00:00 2001
From: olshevskiy87 <olshevskiy87@bk.ru>
Date: Sun, 29 Jun 2014 23:30:04 +0400
Subject: [PATCH] several minor changes an typos' fixing

---
 pgadmin/agent/pgaStep.cpp                          |  2 +-
 .../dd/dditems/figures/ddTextTableItemFigure.cpp   |  4 ++--
 pgadmin/dlg/dlgAggregate.cpp                       |  2 +-
 pgadmin/dlg/dlgColumn.cpp                          |  2 +-
 pgadmin/dlg/dlgFindReplace.cpp                     |  2 +-
 pgadmin/dlg/dlgIndex.cpp                           |  1 -
 pgadmin/dlg/dlgType.cpp                            |  2 +-
 pgadmin/frm/frmOptions.cpp                         |  2 +-
 pgadmin/include/utils/factory.h                    |  1 +
 pgadmin/ogl/oglmisc.cpp                            |  4 ++--
 pgadmin/schema/pgColumn.cpp                        |  2 +-
 pgadmin/schema/pgObject.cpp                        |  1 +
 pgadmin/slony/dlgRepCluster.cpp                    | 28 ++++++++++------------
 pgadmin/utils/factory.cpp                          |  3 +++
 14 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/pgadmin/agent/pgaStep.cpp b/pgadmin/agent/pgaStep.cpp
index 0b49f41..8d62977 100644
--- a/pgadmin/agent/pgaStep.cpp
+++ b/pgadmin/agent/pgaStep.cpp
@@ -251,7 +251,7 @@ void pgaStep::ShowStatistics(frmMain *form, ctlListView *statistics)
 					status = _("Failed");
 				else if (stats->GetVal(1) == wxT("i"))
 					status = _("Ignored");
-				else if (stats->GetVal(1) == wxT("i"))
+				else if (stats->GetVal(1) == wxT("d"))
 					status = _("Aborted");
 				else
 					status = _("Unknown");
diff --git a/pgadmin/dd/dditems/figures/ddTextTableItemFigure.cpp b/pgadmin/dd/dditems/figures/ddTextTableItemFigure.cpp
index ae9f79d..fa73a7b 100644
--- a/pgadmin/dd/dditems/figures/ddTextTableItemFigure.cpp
+++ b/pgadmin/dd/dditems/figures/ddTextTableItemFigure.cpp
@@ -85,7 +85,7 @@ wxString &ddTextTableItemFigure::getText(bool extended)
 	if(showDataType && extended && getOwnerColumn())
 	{
 		wxString ddType = dataTypes()[getDataType()];   //Should use getDataType() & getPrecision(), because when column is fk, type is not taken from this column, instead from original column (source of fk)
-		bool havePrecision = columnType == dt_numeric || dt_bit || columnType == dt_char || columnType == dt_interval || columnType == dt_varbit || columnType == dt_varchar;
+		bool havePrecision = columnType == dt_numeric || columnType == dt_bit || columnType == dt_char || columnType == dt_interval || columnType == dt_varbit || columnType == dt_varchar;
 		if( havePrecision && getPrecision() >= 0)
 		{
 			ddType.Truncate(ddType.Find(wxT("(")));
@@ -124,7 +124,7 @@ wxString ddTextTableItemFigure::getType(bool raw)
 	if(raw)
 		return ddType;
 
-	bool havePrecision = columnType == dt_numeric || dt_bit || columnType == dt_char || columnType == dt_interval || columnType == dt_varbit || columnType == dt_varchar;
+	bool havePrecision = columnType == dt_numeric || columnType == dt_bit || columnType == dt_char || columnType == dt_interval || columnType == dt_varbit || columnType == dt_varchar;
 	if( havePrecision && getPrecision() >= 0)
 	{
 		ddType.Truncate(ddType.Find(wxT("(")));
diff --git a/pgadmin/dlg/dlgAggregate.cpp b/pgadmin/dlg/dlgAggregate.cpp
index d2997b5..624fb9e 100644
--- a/pgadmin/dlg/dlgAggregate.cpp
+++ b/pgadmin/dlg/dlgAggregate.cpp
@@ -123,7 +123,7 @@ dlgAggregate::dlgAggregate(pgaFactory *f, frmMain *frame, pgAggregate *agg, pgSc
 
 					int icon = userFactory.GetIconId();
 
-					if (roleName.Left(6).IsSameAs(wxT("group ")), false)
+					if (roleName.Left(6).IsSameAs(wxT("group "), false))
 					{
 						icon = groupFactory.GetIconId();
 						roleName = wxT("group ") + qtStrip(roleName.Mid(6));
diff --git a/pgadmin/dlg/dlgColumn.cpp b/pgadmin/dlg/dlgColumn.cpp
index 600ab67..7df7930 100644
--- a/pgadmin/dlg/dlgColumn.cpp
+++ b/pgadmin/dlg/dlgColumn.cpp
@@ -147,7 +147,7 @@ dlgColumn::dlgColumn(pgaFactory *f, frmMain *frame, pgColumn *node, pgTable *par
 
 					int icon = userFactory.GetIconId();
 
-					if (roleName.Left(6).IsSameAs(wxT("group ")), false)
+					if (roleName.Left(6).IsSameAs(wxT("group "), false))
 					{
 						icon = groupFactory.GetIconId();
 						roleName = wxT("group ") + qtStrip(roleName.Mid(6));
diff --git a/pgadmin/dlg/dlgFindReplace.cpp b/pgadmin/dlg/dlgFindReplace.cpp
index d358647..c3c956a 100644
--- a/pgadmin/dlg/dlgFindReplace.cpp
+++ b/pgadmin/dlg/dlgFindReplace.cpp
@@ -87,7 +87,7 @@ dlgFindReplace::dlgFindReplace(ctlSQLBox *parent) :
 		rdOriginTop->SetValue(false);
 	}
 
-	// Origin
+	// Direction
 	settings->Read(wxT("FindReplace/Direction"), &val, wxT("f"));
 	if (val == wxT("b"))
 	{
diff --git a/pgadmin/dlg/dlgIndex.cpp b/pgadmin/dlg/dlgIndex.cpp
index 6a97a70..3a54c73 100644
--- a/pgadmin/dlg/dlgIndex.cpp
+++ b/pgadmin/dlg/dlgIndex.cpp
@@ -354,7 +354,6 @@ int dlgIndex::Go(bool modal)
 				descDef = index->GetOrdersArray().Item(colIdx);
 				nullsDef = index->GetNullsArray().Item(colIdx);
 				opclassDef = index->GetOpClassesArray().Item(colIdx);
-				nullsDef = index->GetNullsArray().Item(colIdx);
 
 				lstColumns->InsertItem(colIdx, colDef, columnFactory.GetIconId());
 				lstColumns->SetItem(colIdx, 1, descDef);
diff --git a/pgadmin/dlg/dlgType.cpp b/pgadmin/dlg/dlgType.cpp
index 4d1b434..c71a019 100644
--- a/pgadmin/dlg/dlgType.cpp
+++ b/pgadmin/dlg/dlgType.cpp
@@ -184,7 +184,7 @@ dlgType::dlgType(pgaFactory *f, frmMain *frame, pgType *node, pgSchema *sch)
 
 					int icon = userFactory.GetIconId();
 
-					if (roleName.Left(6).IsSameAs(wxT("group ")), false)
+					if (roleName.Left(6).IsSameAs(wxT("group "), false))
 					{
 						icon = groupFactory.GetIconId();
 						roleName = wxT("group ") + qtStrip(roleName.Mid(6));
diff --git a/pgadmin/frm/frmOptions.cpp b/pgadmin/frm/frmOptions.cpp
index e500998..4b3b1f1 100644
--- a/pgadmin/frm/frmOptions.cpp
+++ b/pgadmin/frm/frmOptions.cpp
@@ -747,7 +747,7 @@ void frmOptions::OnOK(wxCommandEvent &ev)
 	settings->SetSystemSchemas(txtSystemSchemas->GetValue());
 
 	// Save the display options
-	int changed = false;
+	bool changed = false;
 	for (unsigned int x = 0; x < lstDisplay->GetCount(); x++)
 	{
 		if (lstDisplay->IsChecked(x) != settings->GetDisplayOption(lstDisplay->GetString(x)))
diff --git a/pgadmin/include/utils/factory.h b/pgadmin/include/utils/factory.h
index 432675d..3952f1a 100644
--- a/pgadmin/include/utils/factory.h
+++ b/pgadmin/include/utils/factory.h
@@ -156,6 +156,7 @@ private:
 class menuFactory
 {
 public:
+	virtual ~menuFactory();
 	virtual bool IsAction()
 	{
 		return false;
diff --git a/pgadmin/ogl/oglmisc.cpp b/pgadmin/ogl/oglmisc.cpp
index 81bb2ae..c0f93b2 100644
--- a/pgadmin/ogl/oglmisc.cpp
+++ b/pgadmin/ogl/oglmisc.cpp
@@ -266,7 +266,7 @@ void oglCentreText(wxDC &dc, wxList *text_list,
 		i ++;
 	}
 
-	delete widths;
+	delete[] widths;
 }
 
 // Centre a list of strings in the given box
@@ -328,7 +328,7 @@ void oglCentreTextNoClipping(wxDC &dc, wxList *text_list,
 		current = current->GetNext();
 		i ++;
 	}
-	delete widths;
+	delete[] widths;
 }
 
 void oglGetCentredTextExtent(wxDC &dc, wxList *text_list,
diff --git a/pgadmin/schema/pgColumn.cpp b/pgadmin/schema/pgColumn.cpp
index aa3cf1b..3708eea 100644
--- a/pgadmin/schema/pgColumn.cpp
+++ b/pgadmin/schema/pgColumn.cpp
@@ -289,7 +289,7 @@ wxString pgColumn::GetPrivileges()
 			role = strCurrAcl.BeforeLast('=');
 			wxString value = strCurrAcl.Mid(role.Length() + 1).BeforeLast('/');
 
-			if (role.Left(6).IsSameAs(wxT("group ")), false)
+			if (role.Left(6).IsSameAs(wxT("group "), false))
 			{
 				role = wxT("group ") + qtIdent(qtStrip(role.Mid(6)));
 			}
diff --git a/pgadmin/schema/pgObject.cpp b/pgadmin/schema/pgObject.cpp
index 6edab38..93d28bc 100644
--- a/pgadmin/schema/pgObject.cpp
+++ b/pgadmin/schema/pgObject.cpp
@@ -113,6 +113,7 @@ wxString pgObject::GetTranslatedMessage(int kindOfMessage) const
 			break;
 		case BACKUPSERVERTITLE:
 			message = _("Backup unknown object of type");
+			break;
 		case DROPEXCLUDINGDEPS:
 			message = wxString::Format(_("Are you sure you wish to drop object \"%s\"?"),
 			                           GetFullIdentifier().c_str());
diff --git a/pgadmin/slony/dlgRepCluster.cpp b/pgadmin/slony/dlgRepCluster.cpp
index 4296b57..2ac8230 100644
--- a/pgadmin/slony/dlgRepCluster.cpp
+++ b/pgadmin/slony/dlgRepCluster.cpp
@@ -1230,21 +1230,19 @@ wxString dlgRepClusterUpgrade::GetSql()
 
 				if (language == wxT("c"))
 					sql += wxT("\n")
-					       wxT("AS '" + func.GetVal(wxT("probin")) + wxT("', '") +
-					           func.GetVal(wxT("prosrc")) + wxT("'");
-					           else
-						           sql += wxT(" AS\n")
-						                  wxT("$BODY$") + func.GetVal(wxT("prosrc")) + wxT("$BODY$");
-
-						           sql += wxT(" LANGUAGE ")
-						                  +  language;
-
-						           if (volat == wxT("v"))
-						           sql += wxT(" VOLATILE");
-						           else if (volat == wxT("i"))
-							           sql += wxT(" IMMUTABLE"));
-							else
-								sql += wxT(" STABLE");
+					       wxT("AS '" + func.GetVal(wxT("probin")) + wxT("', '") + func.GetVal(wxT("prosrc")) + wxT("'"));
+				else
+					sql += wxT(" AS\n")
+					       wxT("$BODY$") + func.GetVal(wxT("prosrc")) + wxT("$BODY$");
+
+				sql += wxT(" LANGUAGE ") + language;
+
+				if (volat == wxT("v"))
+					sql += wxT(" VOLATILE");
+				else if (volat == wxT("i"))
+					sql += wxT(" IMMUTABLE");
+				else
+					sql += wxT(" STABLE");
 
 				if (func.GetBool(wxT("proisstrict")))
 					sql += wxT(" STRICT");
diff --git a/pgadmin/utils/factory.cpp b/pgadmin/utils/factory.cpp
index 56dd1dd..02b1561 100644
--- a/pgadmin/utils/factory.cpp
+++ b/pgadmin/utils/factory.cpp
@@ -411,6 +411,9 @@ menuFactory::menuFactory(menuFactoryList *list)
 		list->Add(this);
 }
 
+menuFactory::~menuFactory()
+{
+}
 
 actionFactory::actionFactory(menuFactoryList *list) : menuFactory(list)
 {
-- 
1.8.3.msysgit.0

