MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / MRU_AddFile

Function MRU_AddFile

src/Helpers.c:1516–1544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1514}
1515
1516BOOL MRU_AddFile ( LPMRULIST pmru, LPCWSTR pszFile, BOOL bRelativePath, BOOL bUnexpandMyDocs )
1517{
1518 int i;
1519 for ( i = 0; i < pmru->iSize; i++ ) {
1520 if ( lstrcmpi ( pmru->pszItems[i], pszFile ) == 0 ) {
1521 LocalFree ( pmru->pszItems[i] );
1522 break;
1523 } else {
1524 WCHAR wchItem[MAX_PATH];
1525 PathAbsoluteFromApp ( pmru->pszItems[i], wchItem, COUNTOF ( wchItem ), TRUE );
1526 if ( lstrcmpi ( wchItem, pszFile ) == 0 ) {
1527 LocalFree ( pmru->pszItems[i] );
1528 break;
1529 }
1530 }
1531 }
1532 i = min ( i, pmru->iSize - 1 );
1533 for ( ; i > 0; i-- ) {
1534 pmru->pszItems[i] = pmru->pszItems[i - 1];
1535 }
1536 if ( bRelativePath ) {
1537 WCHAR wchFile[MAX_PATH];
1538 PathRelativeToApp ( ( LPWSTR ) pszFile, wchFile, COUNTOF ( wchFile ), TRUE, TRUE, bUnexpandMyDocs );
1539 pmru->pszItems[0] = StrDup ( wchFile );
1540 } else {
1541 pmru->pszItems[0] = StrDup ( pszFile );
1542 }
1543 return ( 1 );
1544}
1545
1546BOOL MRU_Delete ( LPMRULIST pmru, int iIndex )
1547{

Callers 3

MRU_MergeSaveFunction · 0.85
_FileLoadFunction · 0.85
FileSaveFunction · 0.85

Calls 2

PathAbsoluteFromAppFunction · 0.85
PathRelativeToAppFunction · 0.85

Tested by

no test coverage detected