X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/f1f01b21410b676a9c35c93251d5739bb65c711d..cce9538e2005536858b1e2dc3367d04afaf892c4:/Constructor/src/constructor.cpp?ds=sidebyside diff --git a/Constructor/src/constructor.cpp b/Constructor/src/constructor.cpp index e8654c1..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()+1; + + 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()