From 2a0dbc64089453cec7c610ac434212395d1627b6 Mon Sep 17 00:00:00 2001 From: Elena Date: Sat, 19 Oct 2019 17:39:55 +0200 Subject: [PATCH] =?UTF-8?q?Revisa=20el=20texto=20para=20quitar=20acentos?= =?UTF-8?q?=20y=20dem=C3=A1s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OliviaAddIn/Comun.cs | 17 +++++++++++++++-- OliviaAddIn/RecogidaDlg.cs | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/OliviaAddIn/Comun.cs b/OliviaAddIn/Comun.cs index a7067c1..5f64c85 100644 --- a/OliviaAddIn/Comun.cs +++ b/OliviaAddIn/Comun.cs @@ -148,7 +148,7 @@ namespace OliviaAddIn instalacion = (IPoint)geom; x = instalacion.X; y = instalacion.Y; - text_sal = st; + text_sal = revisa_text(st); } } } @@ -239,7 +239,7 @@ namespace OliviaAddIn } FunGDB.libera(fc); //Actualiza el texto de salida - text_sal = text_sal + val_st[i].Replace(" ", string.Empty); + text_sal = text_sal + revisa_text(val_st[i]); /*if(i<(nval-1))//si es el Ășltimo no le pone '_' text_sal = text_sal + "_";*/ } @@ -262,5 +262,18 @@ namespace OliviaAddIn } return true; } + string revisa_text(string text) + { + StringBuilder sb = new StringBuilder(); + foreach (char c in text) + { + if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_') + { + sb.Append(c); + } + } + return sb.ToString(); + } } + } diff --git a/OliviaAddIn/RecogidaDlg.cs b/OliviaAddIn/RecogidaDlg.cs index b4bb9ab..e60a676 100644 --- a/OliviaAddIn/RecogidaDlg.cs +++ b/OliviaAddIn/RecogidaDlg.cs @@ -778,6 +778,7 @@ namespace OliviaAddIn private void checkBox_sens_CheckedChanged(object sender, EventArgs e) { + checkBox_sens.Checked = false; if (checkBox_sens.Checked == true) { btn_edit_camp_sensor.Enabled = checkBox_sens.Checked;