From 00d0491a3bbc627de75dabebcc90e76ac79a96c8 Mon Sep 17 00:00:00 2001 From: Danis Date: Mon, 11 Aug 2025 19:28:07 +0400 Subject: [PATCH 1/3] Added strikethrough button --- .../mobile/src/controller/edit/EditCell.jsx | 6 ++++++ apps/spreadsheeteditor/mobile/src/store/cellSettings.js | 3 +++ apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx | 2 ++ 3 files changed, 11 insertions(+) diff --git a/apps/spreadsheeteditor/mobile/src/controller/edit/EditCell.jsx b/apps/spreadsheeteditor/mobile/src/controller/edit/EditCell.jsx index 3ea369759f..c1835a3212 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/edit/EditCell.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/edit/EditCell.jsx @@ -80,6 +80,11 @@ class EditCellController extends Component { api.asc_setCellUnderline(value); } + toggleStrikethrough(value) { + const api = Common.EditorApi.get(); + api.asc_setCellStrikeout(value); + } + onStyleClick(type) { const api = Common.EditorApi.get(); api.asc_setCellStyle(type); @@ -238,6 +243,7 @@ class EditCellController extends Component { toggleBold={this.toggleBold} toggleItalic={this.toggleItalic} toggleUnderline={this.toggleUnderline} + toggleStrikethrough={this.toggleStrikethrough} onStyleClick={this.onStyleClick} onTextColor={this.onTextColor} onFillColor={this.onFillColor} diff --git a/apps/spreadsheeteditor/mobile/src/store/cellSettings.js b/apps/spreadsheeteditor/mobile/src/store/cellSettings.js index c7e8410c3d..4fdb295122 100644 --- a/apps/spreadsheeteditor/mobile/src/store/cellSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/cellSettings.js @@ -15,6 +15,7 @@ export class storeCellSettings { isBold: observable, isItalic: observable, isUnderline: observable, + isStrikethrough: observable, hAlignStr: observable, vAlignStr: observable, isWrapText: observable, @@ -62,6 +63,7 @@ export class storeCellSettings { isBold = false; isItalic = false; isUnderline = false; + isStrikethrough = false; hAlignStr = 'left'; vAlignStr = 'bottom'; @@ -146,6 +148,7 @@ export class storeCellSettings { this.isBold = xfs.asc_getFontBold(); this.isItalic = xfs.asc_getFontItalic(); this.isUnderline = xfs.asc_getFontUnderline(); + this.isStrikethrough = xfs.asc_getFontStrikeout(); } initEditorFonts(fonts, select) { diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx index 424a565d6b..249b6b3931 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx @@ -73,6 +73,7 @@ const EditCell = props => { const isBold = storeCellSettings.isBold; const isItalic = storeCellSettings.isItalic; const isUnderline = storeCellSettings.isUnderline; + const isStrikethrough = storeCellSettings.isStrikethrough; const fontColorPreview = fontColor !== 'auto' ? : @@ -98,6 +99,7 @@ const EditCell = props => { {props.toggleBold(!isBold)}}>B {props.toggleItalic(!isItalic)}}>I {props.toggleUnderline(!isUnderline)}} style={{textDecoration: "underline"}}>U + {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S Date: Tue, 12 Aug 2025 11:12:34 +0400 Subject: [PATCH 2/3] Fix strikethrough button --- apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx index 249b6b3931..df5b79ec1f 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx @@ -99,7 +99,7 @@ const EditCell = props => { {props.toggleBold(!isBold)}}>B {props.toggleItalic(!isItalic)}}>I {props.toggleUnderline(!isUnderline)}} style={{textDecoration: "underline"}}>U - {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S + {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S Date: Fri, 15 Aug 2025 18:01:01 +0400 Subject: [PATCH 3/3] Added strikethrough on text --- .../mobile/src/controller/edit/EditText.jsx | 6 ++++++ apps/spreadsheeteditor/mobile/src/store/textSettings.js | 3 +++ apps/spreadsheeteditor/mobile/src/view/edit/EditText.jsx | 2 ++ 3 files changed, 11 insertions(+) diff --git a/apps/spreadsheeteditor/mobile/src/controller/edit/EditText.jsx b/apps/spreadsheeteditor/mobile/src/controller/edit/EditText.jsx index d0c1588298..25d148f066 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/edit/EditText.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/edit/EditText.jsx @@ -24,6 +24,11 @@ class EditTextController extends Component { api.asc_setCellUnderline(value); }; + toggleStrikethrough(value) { + const api = Common.EditorApi.get(); + api.asc_setCellStrikeout(value); + } + onParagraphAlign(type) { const api = Common.EditorApi.get(); let value = AscCommon.align_Left; @@ -103,6 +108,7 @@ class EditTextController extends Component { toggleBold={this.toggleBold} toggleItalic={this.toggleItalic} toggleUnderline={this.toggleUnderline} + toggleStrikethrough={this.toggleStrikethrough} onParagraphAlign={this.onParagraphAlign} onParagraphValign={this.onParagraphValign} changeFontSize={this.changeFontSize} diff --git a/apps/spreadsheeteditor/mobile/src/store/textSettings.js b/apps/spreadsheeteditor/mobile/src/store/textSettings.js index 942d1b571c..a24eb5de31 100644 --- a/apps/spreadsheeteditor/mobile/src/store/textSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/textSettings.js @@ -12,6 +12,7 @@ export class storeTextSettings { isBold: observable, isItalic: observable, isUnderline: observable, + isStrikethrough: observable, textColor: observable, customTextColors: observable, paragraphAlign: observable, @@ -53,6 +54,7 @@ export class storeTextSettings { isBold = false; isItalic = false; isUnderline = false; + isStrikethrough = false; textColor = undefined; customTextColors = []; paragraphAlign = undefined; @@ -79,6 +81,7 @@ export class storeTextSettings { this.isBold = xfs.asc_getFontBold(); this.isItalic = xfs.asc_getFontItalic(); this.isUnderline = xfs.asc_getFontUnderline(); + this.isStrikethrough = xfs.asc_getFontStrikeout(); let color = xfs.asc_getFontColor(); // console.log(color); diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditText.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditText.jsx index 312b11aae6..c10a3e8701 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditText.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditText.jsx @@ -39,6 +39,7 @@ const EditText = props => { const isBold = storeTextSettings.isBold; const isItalic = storeTextSettings.isItalic; const isUnderline = storeTextSettings.isUnderline; + const isStrikethrough = storeTextSettings.isStrikethrough; const paragraphAlign = storeTextSettings.paragraphAlign; const paragraphValign = storeTextSettings.paragraphValign; @@ -58,6 +59,7 @@ const EditText = props => { {props.toggleBold(!isBold)}}>B {props.toggleItalic(!isItalic)}}>I {props.toggleUnderline(!isUnderline)}} style={{textDecoration: "underline"}}>U + {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S