Просмотр исходного кода

Win32Core::openFilePicker fixes

Without this patch, the "Add external files" button of the IDE doesn't
work, because the function return an empty files list.
JLouis-B 11 лет назад
Родитель
Сommit
49eb36b0ad
2 измененных файлов с 8 добавлено и 3 удалено
  1. 1 0
      Core/Contents/Include/PolyWinCore.h
  2. 7 3
      Core/Contents/Source/PolyWinCore.cpp

+ 1 - 0
Core/Contents/Include/PolyWinCore.h

@@ -38,6 +38,7 @@
 
 
 #include <vector>
+#include <sstream>
 
 #ifndef VK_0
 #define VK_0	'0'

+ 7 - 3
Core/Contents/Source/PolyWinCore.cpp

@@ -1138,16 +1138,20 @@ std::vector<String> Win32Core::openFilePicker(std::vector<CoreFileExtension> ext
 	ofn.lpstrInitialDir=NULL;
 
 	if(allowMultiple) {
-		ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_EXPLORER;
-	} else {
 		ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_ALLOWMULTISELECT|OFN_EXPLORER;
+	} else {
+		ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_EXPLORER;
 	}
 
 	std::vector<String> retVec;
 
 	if(GetOpenFileName(&ofn)) {
 		if(allowMultiple) {
-
+			std::string buf;
+			std::stringstream filesList(String(fBuffer).getSTLString());
+			
+			while (filesList >> buf)
+				retVec.push_back(buf);
 		} else {
 			retVec.push_back(String(fBuffer));
 		}