From cf38b7e2e6fc55f6702115859567c99555f5fdb5 Mon Sep 17 00:00:00 2001 From: Fedor Kobyakov Date: Mon, 21 Jul 2025 17:11:11 +0300 Subject: [PATCH] [ve] Dont use quickStyleVariation for default themeval values; Fix bug 76044 --- visio/model/VisioDocument.js | 7 +++++++ visio/model/ooxmlApi/convertFunctions.js | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/visio/model/VisioDocument.js b/visio/model/VisioDocument.js index 67fb04b5e1..3e4779bb98 100644 --- a/visio/model/VisioDocument.js +++ b/visio/model/VisioDocument.js @@ -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)); } }; diff --git a/visio/model/ooxmlApi/convertFunctions.js b/visio/model/ooxmlApi/convertFunctions.js index 291b4c2736..b410ef5522 100644 --- a/visio/model/ooxmlApi/convertFunctions.js +++ b/visio/model/ooxmlApi/convertFunctions.js @@ -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