MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / ClearHistory

Method ClearHistory

UTCP/src/uh_ctrl.cpp:1281–1320  ·  view source on GitHub ↗

ClearHistory Clears all items from the history list Params none Return 0 - (UH_SUCCESS) 1 - (UH_ERROR) ***********************************/

Source from the content-addressed store, hash-verified

1279 1 - (UH_ERROR)
1280***********************************/
1281int CUH_Control::ClearHistory(){
1282
1283 //enter into a critical section
1284 #ifdef UH_THREADSAFE
1285 EnterCriticalSection(&m_criticalSection);
1286 #endif
1287
1288 UH_HistoryList *current = m_historyList;
1289 UH_HistoryList *next;
1290 //delete the history list
1291 while(current != NULL){
1292 next= current->m_next;
1293
1294 if(current->m_string != NULL)
1295 delete[] current->m_string;
1296 delete current;
1297
1298 current = next;
1299 }
1300 m_historyList = NULL;
1301 m_HLCurrentPosPtr = NULL;
1302 m_HLCurrentPos = -1;
1303 m_HLEndPosPtr = NULL;
1304 m_HLEndPos = -1;
1305
1306 m_maxLineWidth = 0;
1307
1308 if(m_hWnd != NULL){
1309 UpdateScrollRange();
1310 InvalidateRect(m_hWnd,NULL,TRUE);
1311 SendMessage(m_hWnd,WM_PAINT,0,0);
1312 }
1313
1314 //exit the critical section
1315 #ifdef UH_THREADSAFE
1316 LeaveCriticalSection(&m_criticalSection);
1317 #endif
1318
1319 return UH_SUCCESS;
1320}
1321
1322/**********************************
1323CopyToClipboard

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected