Document processing method and device, electronic equipment and computer readable storage medium

By receiving deletion commands in the spreadsheet and associating the data content of merged cells with the position of other areas, the problem of accidental deletion of merged cell data is solved, thus improving operational efficiency.

CN113869012BActive Publication Date: 2026-04-24ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI KINGSOFT OFFICE SOFTWARE
Filing Date
2021-09-30
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In spreadsheets, when a user selects an entire row or column of cells, if that area contains merged cells, the delete operation may accidentally delete the data in the merged cells, resulting in low efficiency.

Method used

By receiving a deletion command, the system obtains the location information of other parts of the merged cell and associates the data content in the merged cell with other parts of the cell based on this location information. This associates the storage location with other parts of the cell, thus automatically preserving the data content when deleting parts of the merged cell.

Benefits of technology

This effectively avoids accidental deletion of data in merged cells, improves user efficiency, and eliminates the need for additional manual operations to preserve data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113869012B_ABST
    Figure CN113869012B_ABST
Patent Text Reader

Abstract

The application relates to a document processing method and device, electronic equipment and a computer readable storage medium, and relates to the field of automated office work. The method comprises the following steps: receiving a deletion instruction for a target region in a table; the table comprises a merged cell, the target region comprises a partial region of the merged cell, and the region of the merged cell is a non-blank region; acquiring position information of other partial regions of the merged cell; and performing association processing on a storage position of data content in the merged cell and the other partial regions according to the position information of the other partial regions, so that the storage position is associated with the other partial regions. The embodiment of the application can automatically retain the data content in the merged cell when a partial region in the merged cell is deleted, and the user does not need to manually retain the data content in the cell through additional manual operation, thereby effectively improving the operation efficiency of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of office automation, and more specifically, to a document processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] A spreadsheet is a two-dimensional grid with multiple rows and columns. The intersection of a row and a column is called a cell. A rectangular area consisting of one or more cells is called a cell range. For a cell range consisting of multiple cells, merging these cells creates a merged cell. For example... Figure 1 As shown in section (a), for a 5-row, 3-column intersection region ( Figure 1 For the cell range (represented as 5 rows * 3 columns in section (a)), if the user selects the "Merge Cells" option in the settings information corresponding to this intersection area, they can obtain a result like... Figure 1 The 5-row x 3-column merged cell shown in section (b) covers the intersection of the aforementioned 5 rows and 3 columns. In other words, the area of ​​the merged cell is the intersection of the aforementioned 5 rows and 3 columns.

[0003] In spreadsheets, to facilitate the management of cells in each row and column, spreadsheets also include, for example, Figure 1 The row header area and column header area are shown. The row header area includes multiple row headers (e.g., ...). Figure 1 The column header area includes multiple column headers (e.g., row header 1, row header 2, ...). Figure 1 The column headers (A, B, ...) correspond to an entire column of cells. When a user selects a column header, the entire column of cells corresponding to that column header is selected. For example... Figure 1 As shown in section (b), clicking column header C with the mouse will select an entire column of cells (i.e., ...) Figure 1 The cells within the shaded area circled in bold black in section (b) are selected. Similarly, when a user selects a row header, all cells in that row are selected; examples are not provided here.

[0004] In practice, the spreadsheets (spreadsheet applications) mentioned above only allow data such as numbers, formulas, and text to be stored within individual cells. When a user selects a row header or column header, if the selected row or column includes a portion of merged cells (e.g., ...), ... Figure 1As shown in section (b), the entire column of cells corresponding to column header C also includes some cells from merged cells. When a user performs a deletion operation on the selected entire row or column of cells, the data content in the merged cells may also be deleted, resulting in accidental deletion and causing a lot of inconvenience to the user. Summary of the Invention

[0005] This application provides a document processing method, apparatus, electronic device, and computer-readable storage medium, wherein the document includes a table, to effectively solve the technical problem of low operation efficiency when a user performs a deletion operation on an entire row or column of cells in a table. This is because the entire row or column of cells includes a portion of merged cells, causing the data content of the merged cells to be deleted as well, requiring the user to perform additional manual operations to retain the data content in the merged cells.

[0006] According to a first aspect of this application, a document processing method is provided, wherein the document includes a table, the method comprising:

[0007] Receive a deletion instruction for a target area in the table; wherein the table includes merged cells, the target area includes a portion of the merged cells, and the area of ​​the merged cells is a non-blank area;

[0008] Obtain the location information of other parts of the merged cell;

[0009] Based on the location information of the other regions, the storage location of the data content in the merged cell is associated with the other regions, so that the storage location is associated with the other regions.

[0010] Optionally, the step of associating the storage location of the data content in the merged cell with the other partial areas based on the location information of the other partial areas, so that the storage location is associated with the other partial areas, includes:

[0011] Based on the coordinate information of the other partial regions, an associated region is determined in the other partial regions, and the identifier of the storage location is updated to the first location identifier of the associated region.

[0012] Optionally, the other partial area includes the area of ​​at least one cell, and the associated area is the area of ​​any cell among the at least one cell.

[0013] Optionally, before determining the associated region in the other partial regions based on the coordinate information of the other partial regions, the method further includes:

[0014] The location information is determined based on the location of the data storage area in the other partial areas within the area of ​​the merged cell;

[0015] The step of determining the associated region in the other partial regions based on the coordinate information of the other partial regions includes:

[0016] Based on the coordinate information of the other partial regions and the positioning information, the positioning region corresponding to the positioning information is located in the other partial regions, and the positioning region is used as the associated region.

[0017] Optionally, the data storage area is the intersection of a specified row and a specified column in the merged cell, and the positioning information includes: a positioning row determined based on the position of the specified row in the merged cell, and a positioning column determined based on the position of the specified column in the merged cell.

[0018] Optionally, the specified row is the starting row, and the specified column is the starting column.

[0019] Optionally, the other partial area includes a coverage area of ​​multiple cells, and the association processing between the storage location of the data content in the merged cell and the other partial area includes:

[0020] The storage location is associated with multiple sub-regions in the other partial regions.

[0021] Optionally, the deletion instruction includes: a first deletion instruction for a target row in the table or a second deletion instruction for a target column in the table.

[0022] According to a second aspect of this application, a document processing apparatus is also provided, wherein the document includes a table, the apparatus comprising:

[0023] A receiving module is used to receive a deletion instruction for a target area in the table; wherein the table includes merged cells, the target area includes a portion of the merged cells, and the area of ​​the merged cells is a non-blank area;

[0024] The acquisition module is used to acquire the location information of other parts of the merged cell.

[0025] The processing module is used to associate the storage location of the data content in the merged cell with the other partial areas based on the location information of the other partial areas, so that the storage location is associated with the other partial areas.

[0026] Optionally, the processing module includes: determining an associated region in the other partial regions based on the coordinate information of the other partial regions, and updating the identifier of the storage location to a first location identifier of the associated region.

[0027] According to a third aspect of this application, an electronic device is also provided, including a memory and a processor, the memory being used to store a computer program; the processor being used to execute the computer program to implement the method according to the first aspect of this application.

[0028] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program is stored, the computer program implementing the method according to the first aspect of this application when executed by a processor.

[0029] One beneficial effect of this application embodiment is that, for a document including a table, it can receive a deletion instruction for a target area in the table; wherein the table includes merged cells, the target area includes a portion of the merged cells, and the merged cell area is a non-blank area; then, the location information of other portions of the merged cells is obtained; finally, based on the location information of the other portions, the storage location of the data content in the merged cells is associated with the other portions. Therefore, this application embodiment can effectively prevent the data content in the merged cells from being deleted along with the selected cell when the area of ​​the user-selected cell includes a portion of the merged cell, achieving the goal of automatically retaining the data content in the merged cells when deleting a portion of the merged cell. This application embodiment eliminates the need for users to perform additional manual operations to retain the data content in the cells, such as eliminating the need for users to re-enter data content into the new merged cell or return to the interface before the deletion operation to delete the cells in other ways, effectively improving user operation efficiency.

[0030] Other features and advantages of the embodiments of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the embodiments of the present application.

[0032] Figure 1 This is a diagram illustrating the merging of cells, row header areas, column header areas, and the selection of an entire column of cells in a table in related technologies;

[0033] Figure 2This is a flowchart of a document processing method provided in some embodiments of this application;

[0034] Figure 3 This is a schematic diagram illustrating the data content storage location of a merged cell according to some embodiments of this application;

[0035] Figure 4 This is a functional structural block diagram of a document processing apparatus provided in some embodiments of this application;

[0036] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in some embodiments of this application. Detailed Implementation

[0037] Various exemplary embodiments of this application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this application.

[0038] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.

[0039] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0040] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0041] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures. Additionally, in one or more embodiments of this specification, the directional terms "horizontal" and "vertical" are used. "Horizontal" refers to the horizontal direction parallel to the horizontal ground, based on the data content displayed on the client's display interface, with the display interface being recognizable to the naked eye when viewed at eye level, and with the display interface displaying the data content normally and accurately. "Vertical" refers to the vertical direction perpendicular to the horizontal ground, based on the data content displayed on the client's display interface, with the display interface being recognizable to the naked eye when viewed at eye level, and with the display interface displaying the data content normally and accurately.

[0042] It should be noted that the execution subject of this application embodiment can be an application located on a local terminal, or it can be a plugin or software development kit (SDK) or other functional unit set in an application located on a local terminal. This embodiment does not impose any special limitations on this.

[0043] It is understood that the above application can be a native program installed on the terminal (i.e., the client), or it can be a web application in the browser on the terminal. This embodiment does not impose any particular limitation on this.

[0044] Furthermore, the terminals involved in the embodiments of this application may include, but are not limited to, mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers, personal computers (PCs), PDAs (personal digital assistants), wearable devices (such as smart glasses, smartwatches, etc.).

[0045] Hereinafter, various embodiments and examples according to this application will be described with reference to the accompanying drawings.

[0046] <Method Implementation>

[0047] Figure 2 This is a flowchart illustrating a document processing method provided in an embodiment of this application. The document includes tables, such as grid tables. The document can be, for example, a tabular document, a text document, or a presentation document, or any document with table insertion functionality.

[0048] like Figure 2 As shown, the method includes the following steps S210 to S230.

[0049] Step S210: Receive a deletion instruction for the target area in the table; wherein the table includes merged cells, the target area includes a portion of the merged cells, and the merged cell area is a non-blank area.

[0050] In some examples, the target area is the entire row of cells corresponding to a selected row header in the table. In this case, a delete instruction on the target area in the table is equivalent to a first delete instruction on the target row in the table. For example, the delete instruction on the target row is triggered when a user selects a target row corresponding to a row header in the row header area and then selects the delete option for that target row. The partial area of ​​merged cells is the first area corresponding to the intersection of the target row and the merged cells.

[0051] In other examples, the target area is the entire column of cells corresponding to a column header after receiving a user's selection instruction for that column header in the table. In this case, a delete instruction on the target area in the table is equivalent to a second delete instruction on the target column in the table. For example, a delete instruction on the target row is triggered when a user selects a target column corresponding to a column header in the column header area and then selects the delete option for that target column. The portion of the merged cell area is the second area corresponding to the intersection of the target column and the merged cells.

[0052] Merged cell areas are non-blank areas, meaning the merged cell area is not a blank area. A blank area is defined as follows: it contains no characters, the content displayed in the blank area is blank, and the corresponding storage cell does not store data. Merged cell areas are also non-blank areas, meaning the merged cells store data such as numbers, formulas, or text, and the merged cell area displays data such as numbers, formulas, or text.

[0053] The data content of a merged cell is stored in one of the cells within the merged cell.

[0054] It should be noted that the starting row of a merged cell refers to the row with the smallest row header value in that merged cell. In other words, the row header value of the starting row in a merged cell is less than the row header values ​​of the other rows in that merged cell. Similarly, the starting column of a merged cell refers to the column with the first letter of the first column in that merged cell. In other words, the first letter of the first column in a merged cell is located before the first letter of the other columns in that merged cell in the alphabetical order (A to Z).

[0055] Of course, it's understandable that the data content of merged cells is stored in a target cell within the merged cell. This target cell can be the starting cell of the merged cell, or any other cell besides the starting cell. For example, it could be the ending cell of the merged cell, which is the cell corresponding to the intersection of the last row and the last column of the merged cell area. The location identifier of the cell storing the data content in the merged cell has a relationship with the data content (see the equivalence, binding, or mapping relationships described below). This relationship is dynamic, meaning that the cell associated with the data content in this relationship can be changed.

[0056] It should be noted that the last row in a merged cell refers to the row with the largest row header value in that merged cell. In other words, the row header value of the last row in a merged cell is greater than the row header values ​​of the other rows in that merged cell. Similarly, the last column in a merged cell refers to the column with the first letter of the last column in that merged cell. In other words, the first letter of the last column in a merged cell is after the first letter of the other columns in that merged cell in the alphabetical order.

[0057] The storage location of the data content in the merged cell is associated with the data storage area of ​​a portion of the merged cell. This association can be, for example, establishing an equivalent relationship, a binding relationship, or a mapping relationship between the two.

[0058] The association is such that, when an equivalence relationship is established between the two, the storage location of the data content in the merged cell and the data storage area in a portion of the merged cell can be associated as follows: the storage location identifier of the data content in the merged cell is the second location identifier of the data storage area.

[0059] This association means that, when a binding relationship is established between the two, the storage location of the data content in the merged cell and the data storage area in a portion of the merged cell can be bound together as follows: the storage location of the data content in the merged cell is bound to the storage location of the data content in the data storage area.

[0060] This association means that, when a mapping relationship is established between the two, the storage location of the data content in the merged cell and the data storage area in a portion of the merged cell can be associated as follows: the storage location of the data content in the merged cell corresponds to the storage location of the data content in the data storage area.

[0061] Through the above association, the data content of merged cells can be obtained based on the data storage area.

[0062] Step S220: Obtain the location information of other parts of the merged cell area.

[0063] Because the merged cell area is a non-blank area, and the storage location of the data content in the merged cell is associated with the data storage area of ​​a portion of the merged cell area, directly executing a delete command targeting the area containing that portion will delete the data content in that portion, leading to accidental deletion. In this case, the location information of the other portions of the merged cell is obtained so that in a subsequent step (corresponding to step S230), the storage location of the data content in the merged cell can be associated with the other portions based on the location information of the other portions, thus associating the storage location of the data content in the merged cell with the other portions. In this case, since the delete command targets only a portion of the merged cell and not the other portions, after executing the delete command, even though the other portions are associated with the data content of the merged cell, the data content in the merged cell is still preserved because the other portions remain in the table, effectively preventing accidental deletion of the data content in the merged cell. The storage location is the storage address of the data content of the merged cell in the data storage unit of the table.

[0064] The other part of the merged cell area refers to all areas in the merged cell area other than the areas mentioned above.

[0065] The other part of the area can be a range of cells, meaning it can be a range of single cells or a rectangular area consisting of multiple cells. The number of these multiple cells is less than the total number of cells in the merged area.

[0066] Associating the storage location of data content in merged cells with other regions can be done by associating the storage location with the region of one cell in the other region, or by associating the storage location with the overlapping region of multiple cells in the other region. Associating the storage location with the region of multiple cells in the other region includes associating each cell in the other region with the region of that cell.

[0067] The location information of other regions can be the coordinate information of other regions, such as the coordinate information of the starting cell of other regions (e.g., the row header and column header values ​​of the starting cell) and the coordinate information of the ending cell of other regions (the intersection of the first row and the last column of other regions) (e.g., the row header and column header values ​​of the ending cell).

[0068] For example, such as Figure 3As shown, the coordinates of the starting cell of the merged cells are B3, and the coordinates of the ending cell are D7.

[0069] For example, please continue to see Figure 3 As shown, the coordinates of the starting cell of the merged cell range are B3 and the coordinates of the ending cell are B7.

[0070] For example, please continue to see Figure 3 As shown, the coordinates of the starting cell of the merged cell range are C3, and the coordinates of the ending cell are D7.

[0071] In reality, such as Figure 3 As shown, the area F3 to H7 is a schematic diagram illustrating the location of the stored data in each cell of the merged cell (area B3 to D7). Figure 3 The area F3 represents the data content stored in area B3 (or cell B3).

[0072] like Figure 3 As shown, although the data content "1" in the merged cell is displayed as belonging to the merged cell, after selecting the merged cells (range B3~D7), the position in the name column indicated by the arrow is the actual location where the data content of the merged cell is stored. According to... Figure 3 It can be seen that the data content "1" in the merged cell is actually stored in the area B3.

[0073] It is understandable that if the area of ​​the merged cells is a blank area, deleting the target area will obviously not result in the deletion of the data content in the merged cells, so the deletion command can be executed directly.

[0074] Step S230: Based on the location information of other regions, associate the storage location of the data content in the merged cell with other regions, so that the storage location is associated with other regions.

[0075] The location information for other regions can be coordinate information representing the range of other regions, including the coordinates of the starting cell and the ending cell of the other regions.

[0076] The storage location in step S230 is the storage location of the data content of the merged cells.

[0077] In some embodiments, the aforementioned storage location is associated with other partial areas, thereby establishing a relationship between the storage location and the other partial areas. This association process involves establishing an equivalence relationship, binding relationship, or mapping relationship between the associated two areas. In other words, the association process establishes an equivalence relationship, binding relationship, or mapping relationship between the aforementioned storage location and other partial areas.

[0078] Therefore, when the table includes merged cells and the area in the table to be deleted includes a portion of the merged cells, the embodiments of this application can associate the data content of the merged cells with other portions of the merged cells. This effectively prevents the data content of the merged cells from being deleted along with a portion of the merged cells after the deletion command is executed. Users do not need to perform additional manual operations to retain the data content in the cells, thus effectively improving user operation efficiency.

[0079] In some embodiments, when associating a storage location with other partial regions based on the location information of other partial regions, the associated region may be determined in the other partial regions based on the location information (coordinate information) of the other partial regions, and the identifier of the storage location may be updated to the first location identifier of the associated region.

[0080] In some embodiments, the aforementioned other partial regions include a region of at least one cell, and the associated region is a region of any cell in at least one cell.

[0081] In some other embodiments, before performing step S230, the embodiments of this application may also determine the positioning information based on the position of the data storage area in the other partial areas in the total area of ​​the merged cell.

[0082] The aforementioned location information could be, for example, information that enables locating the data storage area across the entire area of ​​merged cells. For instance, if the data storage area is the intersection of a specified row and a specified column within a merged cell, the location information could include: the row to be located based on the position of the specified row within the merged cell, and the column to be located based on the position of the specified column within the merged cell. It should be noted that for any table, there is a cell (data storage area) that stores the data content; the intersection of the specified row and the specified column is that cell. In other words, the row containing the data storage area is the specified row, and the column containing the data storage area is the specified column.

[0083] In some examples, the specified row is the first row, and the specified column is the first column. In other examples, the specified row is the last row, and the specified column is the last column.

[0084] The process of determining the positioning information is as follows: If the row header value of a specified row is less than the row header values ​​of other rows in the merged cells, it means that the specified row is located at the position corresponding to the starting row of the merged cells. In other words, if the specified row is the starting row, then the positioning row is determined to be the starting row. Similarly, if the column header letter of a specified column is after the column header letters of other columns in the merged cells according to the English alphabet, it means that the specified column is located at the position corresponding to the starting column of the merged cells. In other words, if the specified column is the starting column, then the positioning column is determined to be the starting column.

[0085] For example, if the header value of a specified row is greater than the header values ​​of other rows in the merged cells, it means that the specified row is located at the position corresponding to the last row of the merged cells, and the selected row is determined to be the last row. Similarly, if the header letter of a specified column is after the header letters of other columns in the merged cells according to the alphabetical order, it means that the specified column is located at the position corresponding to the last column of the merged cells, and the selected column is determined to be the last column.

[0086] During the execution of step S230, the location area corresponding to the above location information can be located in other parts of the region based on the location information (coordinate information) and positioning information of other parts of the region, and the positioning area can be used as the associated region.

[0087] For example, if the location row and column identified in the above location information are the starting row and starting column, respectively, locating the associated area in other areas can be achieved by defining the intersection of the starting row and starting column in those other areas as the associated area. In this case, if the data storage area is the intersection of the starting row and starting column in a merged cell, the resulting associated area corresponds to the intersection of the starting row and starting column in the other cell area; if the data storage area is the intersection of the last row and last column in a merged cell, the resulting associated area corresponds to the intersection of the last row and last column in the other cell area. In this case, after executing the delete command, the other cell area becomes a new merged cell, and the new merged cell and the original merged cell can be subject to the same data storage, processing, and display rules.

[0088] In some embodiments, the other partial area includes the coverage area of ​​multiple cells, that is, the page area occupied by the other partial area on the display screen is greater than or equal to the page area occupied by the multiple cells together on the display screen. In this case, when performing step S230, the storage location can be associated with multiple sub-regions in the other partial area, that is, the storage location can be associated with the area occupied by each cell in the third area of ​​the other partial area. The third area includes the associated area in the other partial area and the area of ​​at least one cell other than the associated area. A sub-region refers to the page area occupied by a single cell on the display screen, or the page area occupied by multiple cells together on the display screen.

[0089] It is understandable that after associating the storage location with other areas, the aforementioned data content can be written into the associated areas of other areas, or into the cells of the third area.

[0090] Taking a data storage area as the starting cell of a partial area and an associated area as the starting cell of another selected area as an example, when writing data content, the data content can be directly transferred from the starting cell of the partial area to the starting cell of the other partial area; or the data content can be copied to the starting cell of the other partial area, and so on. In this embodiment, the above deletion instruction can be executed before step S230. In this case, the user may be aware of the execution of the deletion instruction, but it will not affect the retention of the data content in the merged cells. Alternatively, the above deletion instruction can be executed after step S230. In this case, the user will not be aware of the execution of the deletion instruction. This application does not limit the order of execution of step S230 and the deletion instruction.

[0091] Therefore, this application embodiment can effectively prevent the data content in the merged cells from being deleted along with the entire row or column of cells selected by the user, even when the selected row or column of cells includes some cells in the merged cells. It achieves the goal of automatically retaining the data content in the merged cells when deleting a part of the merged cells, without requiring the user to perform additional manual operations to retain the data content in the cells. For example, the user does not need to re-enter the data content in the merged cells, or return to the interface before the deletion operation to delete the cells to be deleted in other ways, which effectively improves the user's operation efficiency.

[0092] It should be noted that the above embodiments only use a table file as an example to describe the embodiments of this application. The table processing method in the embodiments of this application can be applied to text documents and presentation documents.

[0093] For example, when a table is inserted into a text document and contains both merged cells and at least one cell, if the area of ​​the merged cells is a non-blank area, the data content of the merged cells is also stored in one of the cells of the merged cells. In this case, after receiving the deletion command as in step S210, the processing flow in steps S220 to S230 above can also be executed for the table in the text document.

[0094] In some embodiments, the deletion instruction may be executed before or after the storage location identifier is updated to the first location identifier of the associated region.

[0095] In some embodiments, when a deletion instruction is received for a target area in a table, where the target area is the entire area of ​​merged cells, this application embodiment may also pop up a preset window in the display interface after receiving the deletion instruction, prompting the user to choose whether to delete the data content in the merged cells or copy / move it to the other areas mentioned above.

[0096] <Equipment Example>

[0097] Figure 4 This is a functional block diagram of a document processing apparatus provided in some embodiments of this application. The document includes tables (i.e., spreadsheets), and may include, for example, tabular documents, text documents, presentation documents, and other documents with table insertion functionality. Figure 4 As shown, the document processing device 40 may include a receiving module 41, an acquisition module 42, and a processing module 43.

[0098] The receiving module 41 is used to receive a deletion instruction for a target area in a table; wherein the table includes merged cells, the target area includes a portion of the merged cells, and the merged cell area is a non-blank area.

[0099] In some examples, the target area is the entire row of cells corresponding to a selected row header in the table. In this case, a delete instruction on the target area in the table is equivalent to a first delete instruction on the target row in the table. For example, the delete instruction on the target row is triggered when a user selects a target row corresponding to a row header in the row header area and then selects the delete option for that target row. The partial area of ​​merged cells is the first area corresponding to the intersection of the target row and the merged cells.

[0100] In other examples, the target area is the entire column of cells corresponding to a column header after receiving a user's selection instruction for that column header in the table. In this case, a delete instruction on the target area in the table is equivalent to a second delete instruction on the target column in the table. For example, a delete instruction on the target row is triggered when a user selects a target column corresponding to a column header in the column header area and then selects the delete option for that target column. The portion of the merged cell area is the second area corresponding to the intersection of the target column and the merged cells.

[0101] Merged cell areas are non-blank areas, meaning the merged cell area is not a blank area. A blank area is defined as follows: it contains no characters, the content displayed in the blank area is blank, and the corresponding storage cell does not store data. Merged cell areas are also non-blank areas, meaning the merged cells store data such as numbers, formulas, or text, and the merged cell area displays data such as numbers, formulas, or text.

[0102] The data content of a merged cell is stored in one of the cells within the merged cell.

[0103] It should be noted that the starting row of a merged cell refers to the row with the smallest row header value in that merged cell. In other words, the row header value of the starting row in a merged cell is less than the row header values ​​of the other rows in that merged cell. Similarly, the starting column of a merged cell refers to the column with the first letter of the first column in that merged cell. In other words, the first letter of the first column in a merged cell is located before the first letter of the other columns in that merged cell in the alphabetical order (A to Z).

[0104] Of course, it's understandable that the data content of merged cells is stored in a target cell within the merged cell. This target cell can be the starting cell of the merged cell, or any other cell besides the starting cell. For example, it could be the ending cell of the merged cell, which is the cell corresponding to the intersection of the last row and the last column of the merged cell area. The location identifier of the cell storing the data content in the merged cell has a relationship with the data content (see the equivalence, binding, or mapping relationships described below). This relationship is dynamic, meaning that the cell associated with the data content in this relationship can be changed.

[0105] It should be noted that the last row in a merged cell refers to the row with the largest row header value in that merged cell. In other words, the row header value of the last row in a merged cell is greater than the row header values ​​of the other rows in that merged cell. Similarly, the last column in a merged cell refers to the column with the first letter of the last column in that merged cell. In other words, the first letter of the last column in a merged cell is after the first letter of the other columns in that merged cell in the alphabetical order.

[0106] The storage location of the data content in the merged cell is associated with the data storage area of ​​a portion of the merged cell. This association can be, for example, establishing an equivalent relationship, a binding relationship, or a mapping relationship between the two.

[0107] The association is such that, when an equivalence relationship is established between the two, the storage location of the data content in the merged cell and the data storage area in a portion of the merged cell can be associated as follows: the storage location identifier of the data content in the merged cell is the second location identifier of the data storage area.

[0108] This association means that, when a binding relationship is established between the two, the storage location of the data content in the merged cell and the data storage area in a portion of the merged cell can be bound together as follows: the storage location of the data content in the merged cell is bound to the storage location of the data content in the data storage area.

[0109] This association means that, when a mapping relationship is established between the two, the storage location of the data content in the merged cell and the data storage area in a portion of the merged cell can be associated as follows: the storage location of the data content in the merged cell corresponds to the storage location of the data content in the data storage area.

[0110] Through the above association, the data content of merged cells can be obtained based on the data storage area.

[0111] Module 42 is used to obtain the location information of other parts of the merged cell.

[0112] Because the merged cell area is a non-blank area, and the storage location of the data content in the merged cell is associated with the data storage area of ​​a portion of the merged cell area, directly executing a delete command targeting the area containing that portion will delete the data content in that portion, leading to accidental deletion. In this case, the location information of the other portions of the merged cell is obtained so that in a subsequent step (corresponding to step S230), the storage location of the data content in the merged cell can be associated with the other portions based on the location information of the other portions, thus associating the storage location of the data content in the merged cell with the other portions. In this case, since the delete command targets only a portion of the merged cell and not the other portions, after executing the delete command, even though the other portions are associated with the data content of the merged cell, the data content in the merged cell is still preserved because the other portions remain in the table, effectively preventing accidental deletion of the data content in the merged cell. The storage location is the storage address of the data content of the merged cell in the spreadsheet's data storage unit.

[0113] The other part of the merged cell area refers to all areas in the merged cell area other than the areas mentioned above.

[0114] The other part of the area can be a range of cells, meaning it can be a range of single cells or a rectangular area consisting of multiple cells. The number of these multiple cells is less than the total number of cells in the merged area.

[0115] Associating the storage location of data content in merged cells with other regions can be done by associating the storage location with a region of one cell in another region, or by associating the storage location with a region of multiple cells in another region. Associating the storage location with a region of multiple cells in another region includes associating each cell in the other region with the storage location.

[0116] The location information of other regions can be the coordinate information of other regions, such as the coordinate information of the starting cell of other regions (e.g., the row header and column header values ​​of the starting cell) and the coordinate information of the ending cell of other regions (the intersection of the first row and the last column of other regions) (e.g., the row header and column header values ​​of the ending cell).

[0117] It is understandable that if the area of ​​the merged cells is a blank area, deleting the target area will obviously not result in the deletion of the data content in the merged cells, so the deletion command can be executed directly.

[0118] The processing module 43 is used to associate the storage location of the data content in the merged cell with the aforementioned other regions based on the location information of other regions, so that the aforementioned storage location is associated with the other regions.

[0119] The location information for other regions can be coordinate information representing the range of other regions, including the coordinates of the starting cell and the ending cell of the other regions.

[0120] The storage location refers to where the data content of the merged cells is stored.

[0121] In some embodiments, the aforementioned storage location is associated with other partial areas, thereby establishing a relationship between the storage location and the other partial areas. This association process involves establishing an equivalence relationship, binding relationship, or mapping relationship between the associated two areas. In other words, the association process establishes an equivalence relationship, binding relationship, or mapping relationship between the aforementioned storage location and other partial areas.

[0122] Therefore, when the table includes merged cells and the area in the table to be deleted includes a portion of the merged cells, the embodiments of this application can associate the data content of the merged cells with other portions of the merged cells. This effectively prevents the data content of the merged cells from being deleted along with a portion of the merged cells after the deletion command is executed. Users do not need to perform additional manual operations to retain the data content in the cells, thus effectively improving user operation efficiency.

[0123] In some embodiments, when associating a storage location with other partial regions based on the location information of other partial regions, the associated region may be determined in other partial regions based on the location information of other partial regions, and the identifier of the storage location may be updated to the first location identifier of the associated region.

[0124] In some embodiments, the aforementioned other partial regions include a region of at least one cell, and the associated region is a region of any cell in at least one cell.

[0125] Therefore, this application embodiment can effectively prevent the data content in the merged cells from being deleted along with the entire row or column of cells selected by the user, even when the selected row or column of cells includes some cells in the merged cells. It achieves the goal of automatically retaining the data content in the merged cells when deleting a part of the merged cells, without requiring the user to perform additional manual operations to retain the data content in the cells. For example, the user does not need to re-enter the data content in the merged cells, or return to the interface before the deletion operation to delete the cells to be deleted in other ways, which effectively improves the user's operation efficiency.

[0126] Optionally, the processing module is used to: determine the associated region in the other regions based on the location information of the other regions, and update the storage location identifier to the first location identifier of the associated region.

[0127] Optionally, the processing module includes: determining the associated region in other partial regions based on the location information (i.e., coordinate information) of other partial regions, and updating the identifier of the storage location to the first location identifier of the associated region.

[0128] Optionally, other partial areas include a region of at least one cell, and associated regions are regions of any cell in at least one cell.

[0129] Optionally, the document processing apparatus further includes: a positioning module, used to determine positioning information based on the position of the data storage area in the merged cell area before the processing module determines the associated area in other partial areas based on the position information of other partial areas;

[0130] The processing module is used to: locate the location area corresponding to the location information in other parts of the region based on the location information and positioning information of other parts of the region, and use the positioning area as the associated region.

[0131] Optionally, the data storage area is the intersection of a specified row and a specified column in the merged cell, and the positioning information includes: the positioning row determined based on the position of the specified row in the merged cell, and the positioning column determined based on the position of the specified column in the merged cell.

[0132] Optionally, specify the starting row and specify the starting column.

[0133] Optionally, other partial areas contain the coverage area of ​​multiple cells, and the processing module is used to: associate the storage location with multiple areas in other partial areas.

[0134] Optionally, the deletion instruction includes: a first deletion instruction for the target row in the table or a second deletion instruction for the target column in the table.

[0135] Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to another embodiment.

[0136] like Figure 5 As shown, the electronic device 50 includes a processor 51 and a memory 52, the memory 52 for storing an executable computer program, and the processor 51 for executing methods as described in any of the above method embodiments under the control of the computer program.

[0137] Each module of the document processing device 40 described above can be implemented by the processor 51 executing the computer program stored in the memory 52 in this embodiment, or it can be implemented by other circuit structures, which are not limited here.

[0138] The electronic device 50 can be a mobile phone, a personal digital assistant (PDA), a wireless handheld device, a tablet computer, a personal computer (PC), a PDA (personal digital assistant), a wearable device (such as smart glasses, smartwatches, etc.).

[0139] This application may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this application.

[0140] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0141] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0142] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing state information from the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.

[0143] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0144] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0145] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.

[0147] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technological improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this application is defined by the appended claims.

Claims

1. A document processing method, characterized in that, The document includes tables, and the method includes: The system receives a deletion command triggered by a user's deletion option for a target area in the table; wherein the table includes merged cells, the target area includes a portion of the merged cells, the area of ​​the merged cells is a non-blank area, and the storage location of the data content in the merged cells is associated with the data storage area in the portion of the merged cells; Obtain the location information of other parts of the merged cell; Based on the location information of the other regions, the storage location of the data content in the merged cell is associated with the other regions, so that the storage location is associated with the other regions, thus preventing the data content in the merged cell from being deleted along with the deletion of the other regions in the merged cell when the deletion instruction is executed.

2. The method according to claim 1, characterized in that, The step of associating the storage location of the data content in the merged cell with the other partial areas based on the location information of the other partial areas, so that the storage location and the other partial areas are associated, includes: Based on the coordinate information of the other partial regions, an associated region is determined in the other partial regions, and the identifier of the storage location is updated to the first location identifier of the associated region.

3. The method according to claim 2, characterized in that, The other partial area includes the area of ​​at least one cell, and the associated area is the area of ​​any cell among the at least one cells.

4. The method according to claim 2, characterized in that, Before determining the associated region in the other partial regions based on their coordinate information, the method further includes: The location information is determined based on the location of the data storage area in the other partial areas within the area of ​​the merged cell; The step of determining the associated region in the other partial regions based on the coordinate information of the other partial regions includes: Based on the coordinate information of the other partial regions and the positioning information, the positioning region corresponding to the positioning information is located in the other partial regions, and the positioning region is used as the associated region.

5. The method according to claim 4, characterized in that, The data storage area is the intersection of a specified row and a specified column in the merged cell. The positioning information includes: a positioning row determined based on the position of the specified row in the merged cell, and a positioning column determined based on the position of the specified column in the merged cell.

6. The method according to claim 5, characterized in that, The specified row is the starting row, and the specified column is the starting column.

7. The method according to claim 1, characterized in that, The other partial area comprises a coverage area of ​​multiple cells. The process of associating the storage location of the data content in the merged cells with the other partial area includes: The storage location is associated with multiple sub-regions in the other partial regions.

8. The method according to claim 1, characterized in that, The deletion instruction includes: a first deletion instruction for a target row in the table or a second deletion instruction for a target column in the table.

9. A document processing device, characterized in that, The document includes a table, and the device includes: A receiving module is used to receive a deletion command triggered by a user's deletion option for a target area in the table; wherein the table includes merged cells, the target area includes a portion of the merged cells, the area of ​​the merged cells is a non-blank area, and the storage location of the data content in the merged cells is associated with the data storage area in the portion of the merged cells; The acquisition module is used to acquire the location information of other parts of the merged cell. The processing module is used to associate the storage location of the data content in the merged cell with the other partial areas based on the location information of the other partial areas, so that the storage location is associated with the other partial areas, and to prevent the data content in the merged cell from being deleted along with the deletion of the partial areas in the merged cell when the deletion instruction is executed.

10. The apparatus according to claim 9, characterized in that, The processing module includes: Used to determine the associated region in the other partial regions based on the coordinate information of the other partial regions, and update the identifier of the storage location to the first location identifier of the associated region.

11. An electronic device, characterized in that, The method includes a memory and a processor, the memory being used to store a computer program; the processor being used to execute the computer program to implement the method according to any one of claims 1-8.

12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Table editing method and device, computer equipment and storage medium

    CN112560417A

  • Table data control method and device

    CN112632930A