File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
sheets/src/commands/commands/utils Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,15 @@ export class Worksheet {
121121 return this . _spanModel ;
122122 }
123123
124+ getStyleDataByHash ( hash : string ) : Nullable < IStyleData > {
125+ const data = this . _styles . get ( hash ) ;
126+ return { ...data } ;
127+ }
128+
129+ setStyleData ( style : IStyleData ) : Nullable < string > {
130+ return this . _styles . setValue ( style ) ;
131+ }
132+
124133 /**
125134 * Get the style of the column.
126135 * @param {number } column The column index
Original file line number Diff line number Diff line change @@ -264,6 +264,19 @@ export function copyRangeStyles(
264264 if ( ! cellValue [ row ] ) {
265265 cellValue [ row ] = { } ;
266266 }
267+
268+ // univer-pro/issues/3016 insert row/column should not reuse border style
269+ if ( typeof cell . s === 'string' ) {
270+ const styleData = worksheet . getStyleDataByHash ( cell . s ) ;
271+ if ( styleData ) {
272+ delete styleData . bd ;
273+ cell . s = worksheet . setStyleData ( styleData ) ;
274+ }
275+ } else {
276+ const styleData = { ...cell . s } ;
277+ delete styleData . bd ;
278+ cell . s = worksheet . setStyleData ( styleData ) ;
279+ }
267280 cellValue [ row ] [ column ] = { s : cell . s } ;
268281 }
269282 }
You can’t perform that action at this time.
0 commit comments