[ve] Dont use quickStyleVariation for default themeval values; Fix bug 76044

This commit is contained in:
Fedor Kobyakov
2025-07-21 17:11:11 +03:00
parent ccf9effcb5
commit cf38b7e2e6
2 changed files with 13 additions and 2 deletions

View File

@ -153,6 +153,12 @@ AscDFH.historyitem_type_VisioWindow = 328;
*/
this.ImageMap = null;
/**
* true if there were no themes in file
* @type {boolean}
*/
this.isNoThemes = false;
// unfinished
// this.EmbeddedData = null;
@ -358,6 +364,7 @@ AscDFH.historyitem_type_VisioWindow = 328;
CVisioDocument.prototype.AfterOpenDocument = function(zip, context) {
if (!this.themes.length) {
AscCommon.consoleLog("No themes found by filenames. Creating default theme");
this.isNoThemes = true;
this.themes.push(AscFormat.GenerateDefaultTheme(null, null));
}
};

View File

@ -312,7 +312,11 @@
}
// calculate variation before pattern bcs pattern can make NoFillUniFill object without color
handleQuickStyleVariation(lineUniFillNoGradient, uniFillForegndNoGradient, this, themeValWasUsedFor);
// use quickStyleVariation only if themes exist in file.
// Default theme which come to visioDocument.themes[0] should not be considered.
if (!visioDocument.isNoThemes) {
handleQuickStyleVariation(lineUniFillNoGradient, uniFillForegndNoGradient, this, themeValWasUsedFor);
}
let lineGradientEnabled;
let lineGradientEnabledCell = this.getCell("LineGradientEnabled");
@ -1045,7 +1049,7 @@
* @param {CUniFill} oStrokeUniFill
* @param {CUniFill} uniFill
* @param {Shape_Type} shape
* @param {{lineUniFillNoGradient: boolean, uniFillForegnd: boolean}} themeValWasUsedFor
* @param {{lineUniFill: boolean, uniFillForegnd: boolean}} themeValWasUsedFor
*/
function handleQuickStyleVariation(oStrokeUniFill, uniFill, shape, themeValWasUsedFor) {
// https://learn.microsoft.com/en-us/openspecs/sharepoint_protocols/ms-vsdx/68bb0221-d8a1-476e-a132-8c60a49cea63?redirectedfrom=MSDN