diff --git a/Sources/Highlight/Highlight.cpp b/Sources/Highlight/Highlight.cpp index 5b345e9..af77814 100644 --- a/Sources/Highlight/Highlight.cpp +++ b/Sources/Highlight/Highlight.cpp @@ -233,7 +233,7 @@ void Highlight::Parse(int32_t start, if (metaData[kkk].beginStart <= resultat.endStop) { // Remove element //EDN_INFO("Erase element=" << kkk); - metaData.Erase(kkk, kkk+1); + metaData.EraseLen(kkk, kkk+1); // Increase the end of search if (kkk < metaData.Size()) { // just befor the end of the next element diff --git a/Sources/ctags/CTagsManager.cpp b/Sources/ctags/CTagsManager.cpp index a89e01c..c585aa3 100644 --- a/Sources/ctags/CTagsManager.cpp +++ b/Sources/ctags/CTagsManager.cpp @@ -170,7 +170,7 @@ void CTagsManager::AddToHistory(int32_t bufferID) for(int32_t iii= m_historyPos; iii < m_historyList.Size(); iii++) { delete(m_historyList[iii]); } - m_historyList.Erase(m_historyPos, m_historyList.Size() - m_historyPos); + m_historyList.EraseLen(m_historyPos, m_historyList.Size() - m_historyPos); } // add the current element BufferManager *myBufferManager = BufferManager::getInstance(); diff --git a/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp b/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp index 4758e99..b399fb5 100644 --- a/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp +++ b/Sources/tools/EdnBuf/EdnBuf_HighLight.cpp @@ -90,17 +90,17 @@ void EdnBuf::RegenerateHighLightAt(int32_t pos, int32_t nbDeleted, int32_t nbAdd m_HLDataPass1.Erase(0); //EDN_DEBUG("1 * Erase 0"); } else { - m_HLDataPass1.Erase(0,stopId); + m_HLDataPass1.EraseLen(0,stopId); //EDN_DEBUG("2 * Erase 0->" << stopId); } } else if(-1 == stopId) { //EDN_DEBUG("3 * Erase " << startId+1 << "-> end"); - m_HLDataPass1.Erase(startId+1, m_HLDataPass1.Size() - startId); + m_HLDataPass1.EraseLen(startId+1, m_HLDataPass1.Size() - startId); stopId = -1; } else { int32_t currentSize = m_HLDataPass1.Size(); //EDN_DEBUG("4 * Erase " << startId+1 << "->" << stopId << " in " << currentSize << " elements" ); - m_HLDataPass1.Erase(startId+1, stopId - startId); + m_HLDataPass1.EraseLen(startId+1, stopId - startId); if (stopId == currentSize-1) { stopId = -1; } diff --git a/Sources/tools/NameSpaceEdn/String.cpp b/Sources/tools/NameSpaceEdn/String.cpp index 89beabd..3049267 100644 --- a/Sources/tools/NameSpaceEdn/String.cpp +++ b/Sources/tools/NameSpaceEdn/String.cpp @@ -471,7 +471,7 @@ void Edn::String::Remove(int32_t currentID, int32_t len) return; } // TODO : check the size of the data - m_data.Erase(currentID, len); + m_data.EraseLen(currentID, len); } diff --git a/Sources/tools/NameSpaceEdn/VectorType.h b/Sources/tools/NameSpaceEdn/VectorType.h index 8d32998..82f3aca 100644 --- a/Sources/tools/NameSpaceEdn/VectorType.h +++ b/Sources/tools/NameSpaceEdn/VectorType.h @@ -474,7 +474,33 @@ template class VectorType } /** - * @brief Remove one element + * @brief Remove N elements + * + * @param[in] pos Position to remove the data + * @param[in] posEnd Last position number + * + * @return --- + * + */ + void Erase(int32_t pos, int32_t posEnd) + { + if (pos>m_size) { + EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size); + return; + } + if (posEnd>m_size) { + posEnd = m_size; + } + int32_t nbElement = m_size - pos; + int32_t tmpSize = m_size; + // move curent data + memmove((m_data + pos), (m_data + pos + nbElement), (tmpSize - (pos+nbElement))*sizeof(MY_TYPE) ); + // Request resize of the current buffer + Resize(m_size-nbElement); + } + + /** + * @brief Remove N element * * @param[in] pos Position to remove the data * @param[in] nbElement number of element to remove @@ -482,10 +508,10 @@ template class VectorType * @return --- * */ - void Erase(int32_t pos, int32_t nbElement) + void EraseLen(int32_t pos, int32_t nbElement) { if (pos>m_size) { - EDN_ERROR(" can not Erase Element at this position : " << pos << " > " << m_size); + EDN_ERROR(" can not Erase Len Element at this position : " << pos << " > " << m_size); return; } if (pos+nbElement>m_size) { diff --git a/avancement.boo b/avancement.boo index ce3d7f3..7cf94aa 100644 --- a/avancement.boo +++ b/avancement.boo @@ -15,19 +15,21 @@ - Project manager phase 1 # action a faire (ordonner par révision) : - * 0.1.X : - - Edn::VectorType : Rewrite the erase fuction to support start => stop and Erase len methode ... * 0.2.X : + - gui : Amelioration du full-screen et du display de base (sans l'entete de la fenetre) - gui : Mise en place d'un display ligne par ligne + - gui : ascenceur quand nécessaire - gui : Demander la création de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande) - sys : Mise en place des colorisation de base pour le * java script * SQL - - gui : ascenceur quand nécessaire - Catch Shift+TAB - Correction du bug des entré bizard tel que les chapot et les guillemets - pb de sélection quand la ligne est pleine et la première ligne séctionnée. - PB de copier coller sur les éàè ... + - PB sur le caplock et les caractère multiples type chapot ... + - PB du entrer sur le kaypad qui fait un ==> ajouter la fonction shift+enter qui cree un + - catch F[1-12] ==> for user function * 0.3.X : - Charset UTF-8 et iso 8859-15 correcte - Transformation de charset a la volée