mirror of
https://github.com/ONLYOFFICE/desktop-sdk.git
synced 2026-02-10 18:15:05 +08:00
Merge branch 'release/v9.2.0' into bugfix/ai-agent
This commit is contained in:
@ -4793,6 +4793,30 @@ window.AscDesktopEditor.CallInFrame(\"" +
|
||||
SEND_MESSAGE_TO_BROWSER_PROCESS(message);
|
||||
return true;
|
||||
}
|
||||
else if (name == "getOfficeFileType")
|
||||
{
|
||||
if (arguments.size() < 1)
|
||||
{
|
||||
retval = CefV8Value::CreateInt(-1);
|
||||
return true;
|
||||
}
|
||||
|
||||
int nFileType = 0;
|
||||
std::wstring sFileUrl = arguments[0]->GetStringValue().ToWString();
|
||||
|
||||
if (g_pLocalResolver->Check(sFileUrl))
|
||||
{
|
||||
COfficeFileFormatChecker oChecker;
|
||||
bool bIsOfficeFile = oChecker.isOfficeFile(sFileUrl);
|
||||
if (bIsOfficeFile)
|
||||
{
|
||||
nFileType = oChecker.nFileType;
|
||||
}
|
||||
}
|
||||
|
||||
retval = CefV8Value::CreateInt(nFileType);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Function does not exist.
|
||||
return false;
|
||||
@ -5414,7 +5438,7 @@ if (targetElem) { targetElem.dispatchEvent(event); }})();";
|
||||
|
||||
CefRefPtr<CefV8Handler> handler = pWrapper;
|
||||
|
||||
#define EXTEND_METHODS_COUNT 196
|
||||
#define EXTEND_METHODS_COUNT 197
|
||||
const char* methods[EXTEND_METHODS_COUNT] = {
|
||||
"Copy",
|
||||
"Paste",
|
||||
@ -5688,6 +5712,8 @@ if (targetElem) { targetElem.dispatchEvent(event); }})();";
|
||||
|
||||
"_saveAndOpen",
|
||||
|
||||
"getOfficeFileType",
|
||||
|
||||
NULL};
|
||||
|
||||
ExtendObject(obj, handler, methods);
|
||||
|
||||
@ -369,7 +369,8 @@ namespace NSProcesses
|
||||
if (cmd.empty())
|
||||
return cmd;
|
||||
|
||||
std::vector<std::wstring> extensions = {L"", L".exe", L".bat"};
|
||||
// https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/path
|
||||
std::vector<std::wstring> extensions = {L".exe", L".com", L".bat", L".cmd", L""};
|
||||
|
||||
if (true)
|
||||
{
|
||||
@ -557,6 +558,14 @@ namespace NSProcesses
|
||||
(LPVOID)(envBlock.c_str()), nullptr, &si, &m_pi))
|
||||
{
|
||||
DWORD dwError = GetLastError();
|
||||
|
||||
CloseHandle(m_hStdOutWr);
|
||||
CloseHandle(m_hStdErrWr);
|
||||
CloseHandle(m_hStdInRd);
|
||||
m_hStdOutWr = nullptr;
|
||||
m_hStdErrWr = nullptr;
|
||||
m_hStdInRd = nullptr;
|
||||
|
||||
m_callback->process_callback(m_id, StreamType::Terminate, "");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user