File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 3838
3939
4040#include  < vector> 
41- #include  < sstream> 
4241
4342#ifndef  VK_0
4443#define  VK_0 	' 0' 
Original file line number Diff line number Diff line change @@ -1147,11 +1147,26 @@ std::vector<String> Win32Core::openFilePicker(std::vector<CoreFileExtension> ext
11471147
11481148	if (GetOpenFileName (&ofn)) {
11491149		if (allowMultiple) {
1150+ 			String path = fBuffer ;
1151+ 
11501152			std::string buf;
1151- 			std::stringstream filesList (String (fBuffer ).getSTLString ());
1152- 			
1153- 			while  (filesList >> buf)
1154- 				retVec.push_back (buf);
1153+ 			for  (int  i = ofn.nFileOffset ; i < sizeof ( fBuffer  ); i++)
1154+ 			{
1155+ 				if  (fBuffer [i] != NULL )
1156+ 					buf.push_back (fBuffer [i]);
1157+ 				else  if  (fBuffer [i-1 ] != NULL )
1158+ 				{
1159+ 					retVec.push_back (path + " /"   + buf);
1160+ 					buf = " "  ;
1161+ 				}
1162+ 				else  //  2 NULL characters = no more files
1163+ 					break ;
1164+ 			}
1165+ 			if  (retVec.size () == 1 )
1166+ 			{
1167+ 				retVec.clear ();
1168+ 				retVec.push_back (path); //  If only 1 file selected, path is the full path of the file
1169+ 			}
11551170		} else  {
11561171			retVec.push_back (String (fBuffer ));
11571172		}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments