Skip to content

Commit 49eb36b

Browse files
committed
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.
1 parent d40a6f7 commit 49eb36b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Core/Contents/Include/PolyWinCore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939

4040
#include <vector>
41+
#include <sstream>
4142

4243
#ifndef VK_0
4344
#define VK_0 '0'

Core/Contents/Source/PolyWinCore.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,16 +1138,20 @@ std::vector<String> Win32Core::openFilePicker(std::vector<CoreFileExtension> ext
11381138
ofn.lpstrInitialDir=NULL;
11391139

11401140
if(allowMultiple) {
1141-
ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_EXPLORER;
1142-
} else {
11431141
ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_ALLOWMULTISELECT|OFN_EXPLORER;
1142+
} else {
1143+
ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_EXPLORER;
11441144
}
11451145

11461146
std::vector<String> retVec;
11471147

11481148
if(GetOpenFileName(&ofn)) {
11491149
if(allowMultiple) {
1150-
1150+
std::string buf;
1151+
std::stringstream filesList(String(fBuffer).getSTLString());
1152+
1153+
while (filesList >> buf)
1154+
retVec.push_back(buf);
11511155
} else {
11521156
retVec.push_back(String(fBuffer));
11531157
}

0 commit comments

Comments
 (0)