From cce9538e2005536858b1e2dc3367d04afaf892c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicol=C3=A1s=20Dimov?= Date: Sun, 30 Nov 2003 00:00:12 +0000 Subject: [PATCH] aregle lo del id, pero seria conveniente que hagan la prueba, creo que anda bien --- Constructor/src/constructor.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Constructor/src/constructor.cpp b/Constructor/src/constructor.cpp index 4ab81de..29c399f 100644 --- a/Constructor/src/constructor.cpp +++ b/Constructor/src/constructor.cpp @@ -319,7 +319,25 @@ void Constructor::on_load_from_xml() } std::cout << "CARGA COMPLETA" << std::endl; file_open_selection->hide(); - id = listaItems.size()+lista_logic_Items.size()+2; + + int id_1 = -1 , id_2 = -1; + std::list::iterator i = listaItems.begin(); + while ( i != listaItems.end() ){ + if ( (*i)->get_id() >= id_1 ) + id_1 = (*i)->get_id(); + i++; + } + id_1++; + + i = lista_logic_Items.begin(); + while ( i != lista_logic_Items.end() ){ + if ( (*i)->get_id() >= id_2 ) + id_2 = (*i)->get_id(); + i++; + } + id_2++; + if ( id_1 < id_2 ) id = id_2; + else id = id_1; } void Constructor::on_btn_file_ok_clicked() -- 2.43.0