Skip to content

Commit

Permalink
Copy initialDirectory to ofn.lpstrFile so GetSaveFileName uses the fo…
Browse files Browse the repository at this point in the history
…lder we specify
  • Loading branch information
mynetx committed Nov 29, 2012
1 parent 98fd950 commit 5325210
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions appshell/appshell_extensions_win.cpp
Expand Up @@ -82,10 +82,10 @@ class LiveBrowserMgrWin
LiveBrowserMgrWin();
virtual ~LiveBrowserMgrWin();

UINT m_closeLiveBrowserHeartbeatTimerId;
UINT m_closeLiveBrowserTimeoutTimerId;
CefRefPtr<CefProcessMessage> m_closeLiveBrowserCallback;
CefRefPtr<CefBrowser> m_browser;
UINT m_closeLiveBrowserHeartbeatTimerId;
UINT m_closeLiveBrowserTimeoutTimerId;
CefRefPtr<CefProcessMessage> m_closeLiveBrowserCallback;
CefRefPtr<CefBrowser> m_browser;

static LiveBrowserMgrWin* s_instance;
};
Expand Down Expand Up @@ -515,11 +515,11 @@ int32 ShowSaveDialog(ExtensionString title,
ExtensionString fileTypes,
ExtensionString& selectedFile)
{
wchar_t szFile[MAX_PATH];
szFile[0] = 0;
wchar_t* szFile = new wchar_t[MAX_PATH];

// ofn.lpstrInitialDir needs Windows path on XP and not Unix path.
ConvertToNativePath(initialDirectory);
wcscpy(szFile, initialDirectory.c_str());

OPENFILENAME ofn;

Expand All @@ -538,7 +538,7 @@ int32 ShowSaveDialog(ExtensionString title,
ofn.lpstrInitialDir = initialDirectory.c_str();
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR | OFN_EXPLORER;

selectedFile = L"";
selectedFile = L"";
if (GetSaveFileName(&ofn)) {
selectedFile = szFile;
}
Expand Down

0 comments on commit 5325210

Please sign in to comment.