X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/3314f9284024c7bb9e618f310ca467a93990922d..cce9538e2005536858b1e2dc3367d04afaf892c4:/Constructor/src/constructor.cpp 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()