Skip to content

Commit

Permalink
[feature] Allow open vsdx
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Nov 10, 2024
1 parent cb5b51d commit 8b8dacf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 6 additions & 1 deletion DocService/sources/DocsCoServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ const cfgTableChanges = config.get('services.CoAuthoring.sql.tableChanges');
const EditorTypes = {
document : 0,
spreadsheet : 1,
presentation : 2
presentation : 2,
draw : 3
};

const defaultHttpPort = 80, defaultHttpsPort = 443; // Default ports (for http and https)
Expand Down Expand Up @@ -1499,6 +1500,9 @@ function getOpenFormatByEditor(editorType) {
case EditorTypes.presentation:
res = constants.AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION;
break;
case EditorTypes.draw:
res = constants.AVS_OFFICESTUDIO_FILE_DRAW_VSDX;
break;
default:
res = constants.AVS_OFFICESTUDIO_FILE_CANVAS_WORD;
break;
Expand Down Expand Up @@ -3113,6 +3117,7 @@ exports.install = function(server, callbackFunction) {
fCheckLock = _checkLockExcel;
break;
case EditorTypes.presentation:
case EditorTypes.draw:
// PP
fCheckLock = _checkLockPresentation;
break;
Expand Down
10 changes: 8 additions & 2 deletions DocService/sources/canvasservice.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,10 @@ function* commandOpen(ctx, conn, cmd, outputData, opt_upsertRes, opt_bIsRestore)
cmd.setForgotten(cmd.getDocId());
}
//add task
cmd.setOutputFormat(docsCoServer.getOpenFormatByEditor(conn.editorType));
if (!cmd.getOutputFormat()) {
//todo remove getOpenFormatByEditor after 8.2.1
cmd.setOutputFormat(docsCoServer.getOpenFormatByEditor(conn.editorType));
}
cmd.setEmbeddedFonts(false);
var dataQueue = new commonDefines.TaskQueueData();
dataQueue.setCtx(ctx);
Expand Down Expand Up @@ -576,7 +579,10 @@ function* commandReopen(ctx, conn, cmd, outputData) {
if (upsertRes.affectedRows > 0) {
//add task
cmd.setUrl(null);//url may expire
cmd.setOutputFormat(docsCoServer.getOpenFormatByEditor(conn.editorType));
if (!cmd.getOutputFormat()) {
//todo remove getOpenFormatByEditor after 8.2.1
cmd.setOutputFormat(docsCoServer.getOpenFormatByEditor(conn.editorType));
}
cmd.setEmbeddedFonts(false);
if (isPassword) {
cmd.setUserConnectionId(conn.user.id);
Expand Down

0 comments on commit 8b8dacf

Please sign in to comment.