mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[macos] Fixed bug #47069
This commit is contained in:
@ -1085,18 +1085,21 @@
|
||||
[openPanel beginSheetModalForWindow:[NSApp mainWindow] completionHandler:^(NSInteger result){
|
||||
[openPanel orderOut:self];
|
||||
|
||||
CAscApplicationManager * appManager = [NSAscApplicationWorker getAppManager];
|
||||
|
||||
NSEditorApi::CAscLocalOpenFileDialog * imageInfo = new NSEditorApi::CAscLocalOpenFileDialog();
|
||||
imageInfo->put_Id((int)fileId);
|
||||
|
||||
if (result == NSFileHandlingPanelOKButton) {
|
||||
CAscApplicationManager * appManager = [NSAscApplicationWorker getAppManager];
|
||||
|
||||
NSEditorApi::CAscLocalOpenFileDialog * imageInfo = new NSEditorApi::CAscLocalOpenFileDialog();
|
||||
imageInfo->put_Id((int)fileId);
|
||||
imageInfo->put_Path([[[openPanel URL] path] stdwstring]);
|
||||
|
||||
NSEditorApi::CAscMenuEvent* pEvent = new NSEditorApi::CAscMenuEvent(ASC_MENU_EVENT_TYPE_CEF_LOCALFILE_ADDIMAGE);
|
||||
pEvent->m_pData = imageInfo;
|
||||
|
||||
appManager->Apply(pEvent);
|
||||
} else {
|
||||
imageInfo->put_Path(L"");
|
||||
}
|
||||
|
||||
NSEditorApi::CAscMenuEvent* pEvent = new NSEditorApi::CAscMenuEvent(ASC_MENU_EVENT_TYPE_CEF_LOCALFILE_ADDIMAGE);
|
||||
pEvent->m_pData = imageInfo;
|
||||
|
||||
appManager->Apply(pEvent);
|
||||
}];
|
||||
}
|
||||
}
|
||||
@ -1144,23 +1147,26 @@
|
||||
[openPanel beginSheetModalForWindow:[NSApp mainWindow] completionHandler:^(NSInteger result){
|
||||
[openPanel orderOut:self];
|
||||
|
||||
CAscApplicationManager * appManager = [NSAscApplicationWorker getAppManager];
|
||||
|
||||
NSEditorApi::CAscLocalOpenFileDialog * imageInfo = new NSEditorApi::CAscLocalOpenFileDialog();
|
||||
imageInfo->put_Id((int)fileId);
|
||||
imageInfo->put_Filter([fileTypes stdwstring]);
|
||||
|
||||
if (result == NSFileHandlingPanelOKButton) {
|
||||
CAscApplicationManager * appManager = [NSAscApplicationWorker getAppManager];
|
||||
|
||||
NSEditorApi::CAscLocalOpenFileDialog * imageInfo = new NSEditorApi::CAscLocalOpenFileDialog();
|
||||
imageInfo->put_Id((int)fileId);
|
||||
imageInfo->put_Filter([fileTypes stdwstring]);
|
||||
imageInfo->put_Path([[[openPanel URL] path] stdwstring]);
|
||||
|
||||
if (isMulti) {
|
||||
imageInfo->put_IsMultiselect(true);
|
||||
}
|
||||
|
||||
NSEditorApi::CAscMenuEvent* pEvent = new NSEditorApi::CAscMenuEvent(ASC_MENU_EVENT_TYPE_DOCUMENTEDITORS_OPENFILENAME_DIALOG);
|
||||
pEvent->m_pData = imageInfo;
|
||||
|
||||
appManager->Apply(pEvent);
|
||||
} else {
|
||||
imageInfo->put_Path(L"");
|
||||
}
|
||||
|
||||
if (isMulti) {
|
||||
imageInfo->put_IsMultiselect(true);
|
||||
}
|
||||
|
||||
NSEditorApi::CAscMenuEvent* pEvent = new NSEditorApi::CAscMenuEvent(ASC_MENU_EVENT_TYPE_DOCUMENTEDITORS_OPENFILENAME_DIALOG);
|
||||
pEvent->m_pData = imageInfo;
|
||||
|
||||
appManager->Apply(pEvent);
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user