Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(sheets): do not copy cell bg color to rich text bg (#3207)

Ran Luoe293aca27fec
diff --git a/packages/sheets/src/basics/cell-style.ts b/packages/sheets/src/basics/cell-style.ts
index 25e775a3e1..92ac7cea2a 100644
--- a/packages/sheets/src/basics/cell-style.ts
+++ b/packages/sheets/src/basics/cell-style.ts
@@ -127,7 +127,8 @@ function mergeStyle(
const backupStyle: Record<string, any> = Tools.deepClone(oldStyle) || {};
if (!backupStyle) return;
for (const k in newStyle) {
- if (isRichText && ['bd', 'tr', 'td', 'ht', 'vt', 'tb', 'pd'].includes(k)) {
+ // Do not copy cell background color to rich text background color.
+ if (isRichText && ['bd', 'tr', 'td', 'ht', 'vt', 'tb', 'pd', 'bg'].includes(k)) {
continue;
}
// you can only choose one of the themeColor and rgbColor of the border setting
diff --git a/packages/sheets/src/commands/mutations/set-range-values.mutation.ts b/packages/sheets/src/commands/mutations/set-range-values.mutation.ts
index ef891afba1..0731158d62 100644
--- a/packages/sheets/src/commands/mutations/set-range-values.mutation.ts
+++ b/packages/sheets/src/commands/mutations/set-range-values.mutation.ts
@@ -101,7 +101,6 @@ export const SetRangeValuesUndoMutationFactory = (
/**
* TODO@Dushusir: Excel can display numbers with up to about 15 digits of precision. When the user inputs more than 15 digits, interception is required, but there are unknown performance risks.
-
Intercept 15-digit number reference function truncateNumber
*/
export const SetRangeValuesMutation: IMutation<ISetRangeValuesMutationParams, boolean> = {