Tables in Impress
Currently OpenOffice.org Impress and Draw lacks the native support for tables. It is possible to create tables by embedding a OpenOffice.org Calc object or by 'drawing' a table by using multiple shapes. Both methods are neither user friendly nor accessible. The user expects a native support for tables like it is available in the OpenOffice.org Writer application for example. This specification defines a feature set that a common user expects from a native table implementation in OpenOffice.org Impress and Draw and also how it should be accessible on the user interface. It also takes into account the interoperability requirements with other similar products.
- 1 Tables in Impress
- 1.1 Abstract
- 1.2 References
- 1.3 Contacts
- 1.4 Acronyms and Abbreviations
- 1.5 Table Model
- 1.5.1 Table Contents
- 1.5.2 Table Properties
- 1.5.3 Row Properties
- 1.5.4 Column Properties
- 1.5.5 Cell Properties
- 1.5.6 Selection and Focus
- 1.5.7 Table Designs
- 1.6 Operations on Tables
- 1.6.1 Insert
- 1.6.2 Resizing
- 1.6.3 Text editing
- 1.6.4 Delete Columns
- 1.6.5 Delete Rows
- 1.6.6 Insert Columns
- 1.6.7 Insert Rows
- 1.6.8 Merge Cells
- 1.6.9 Split Cells
- 1.6.10 Change Row Height
- 1.6.11 Change Column Width
- 1.6.12 Distribute Rows Equally
- 1.6.13 Distribute Columns Evenly
- 1.6.14 Select Row
- 1.6.15 Select Column
- 1.6.16 Select Cell
- 1.7 Keyboard interactions
- 1.8 Mouse interactions
- 1.9 User interface
- 1.9.1 Table Design Panel
- 1.9.2 Table Design Dialog
- 1.9.3 Table shape context menu
- 1.9.4 Insert Table Dialog
- 1.9.5 Split Cells Dialog
- 1.9.6 Table toolbar
- 1.10 Clipboard operations
- 1.11 Migration
- 1.12 Configuration
- 1.13 File Format
- 1.14 Open Issues
|Reference Document||Check||Location (URL)|
|Specification Process Entry Check||[passed/failed]||n/a|
|Product Requirement, RFE, Issue ID (required)||available||issue 68103|
|Product Concept Document||[available/not available]||<PLEASE ENTER LOCATION HERE>|
|Test case specification (required)||[available/not available]||<PLEASE ENTER LOCATION HERE>|
|IDL Specification||[available/not available]||<PLEASE ENTER LOCATION HERE>|
|Software Specification Rules||n/a||n/a|
|Quality Assurance||Wolfram Gartenfirstname.lastname@example.org|
|User Experience||Frank Loehmannemail@example.com|
Acronyms and Abbreviations
|Acronym / Abbreviation||Definition|
|<WYSIWYG>||<What You See Is What You Get>|
This section describes the model of a table shape inside impress and draw.
A table in impress is presented to the user as a shape. All patterns that apply to all generic shapes also apply to tables. A table shape is a rectangle area build of cells that are arranged in horizontal rows and vertical columns. All rows and columns are always completely visible inside the rectangle that defines the table. No scrolling is needed to see all tables if the table itself is completely visible. Resizing the table itself will also resize the containing cells so that all cells fit in the new rectangle. Adjacent cells can be merged so that the first merged cell occupies the area of all merged cells. All other merged cells will be invisible as long as they are part of a merge. A cell itself can contain text with multiple paragraphs.
Position & Size
As a shape, the table shape is placed on a slide and has a position and a size. Table shapes can not be rotated, so the position and size defines the rectangle area on the slide that is used to render all contained cells, excluding shadow and reflection. In contrast to using an embedded Calc object for tables, the position and size during editing a tables contents in Impress is always “what you see is what you get”.
Each table shape will have a table style assigned that defines the formating properties for the cells if the properties are not hard set on the table or cell itself.
Formating properties can be hard set on the table. They will override the formating properties from the table style and are used when the user creates new content like text or new cells. If the user sets new formating properties to a table, these properties will also be hard set to each cell in that table. The following properties are supported
- cell properties (com.sun.star.drawing.CellProperties)
- character properties (com.sun.star.style.CharacterProperties, com.sun.star.style.CharacterPropertiesAsien, com.sun.star.style.CharacterPropertiesComplex )
- paragraph properties (com.sun.star.style.ParagraphProperties, com.sun.star.style.ParagraphPropertiesAsien, com.sun.star.style.ParagraphPropertiesComplex )
- fill properties (com.sun.star.drawing.FillProperties)
Layout properties are hard set on the table. They help define the overall layout of the table and how the table style is used on the containing cells.
If a row has an assigned height, this is the absolute height of that row. If no height is assigned, a best fit algorithm is used to calculate the height depending on the maximum text height of all cells in that row, the height of all other rows and the overall table height. The sum of all column heights must not exceed the height of the table shape. If this is designated than the height of the table shape must also be changed to fit all rows.
Each column has an assigned with. The sum of all column width must be exactly the width of the table shape.
Each cell supports all formatting properties that are also available on the table itself. All properties set on the cell directly override the properties from the table style. Which of the formatting options from the tables style is used depends on the tables layout properties. The default formatting option is the uneven horizontal banding formation. Formatting properties set directly on the table do not override the formatting properties on cells, they are only used when creating new cells or adding text to cells without text.
If a cell is the first cell in a horizontal range of merged cells, this property defines the number of horizontal cells that are merged.
If a cell is the first cell in a vertical range of merged cells, this property defines the number of vertical cells that are merged.
All cells that are part of a range of merged cells, excluding the first cell, have this property set to true.
Selection and Focus
- A selection consist of one or more selected cells.
- If a selection is available there will be no text cursor visible.
- If an operation creates the text cursor, all selected cells will be deselected.
- A cell has the focus if there is a text cursor inside that cell.
- If an operation needs a cell with a focus and no cell has the focus but there is an active selection, the first cell of that selection will become the focus.
- There can only be either a text selection or selected cells, not both. Creating a text selection deselects all cells. Selecting cells deselects all selected text.
Table designs can be changed from the Table Design pane on the task panel in impress or from the Table Design dialog in draw.
A Table Design is a set of predefined cell styles that are dynamically assigned to the cells of a table. The styles available are
- header row
- total row
- first column
- last column
- vertical banding
- horizontal banding
For each individual table it can be customized which of the first six styles are used. If none of the first six styles is used or available, the default style of the Table Design will be used. The first style in the list that is available in the Table Design and used by the table is assigned to a cell. For example the top left cell will get the "header row" style if it is available and the table is formated to use the header row. If not, it gets the first column style, if that is available and the table is formated to use the first column. If not, vertical banding is checked, than horizontal banding and if nothing fits, the default is used.
The default style is also the parent style for all other styles of a table design. This means that all settings from the default style are also applied to the other styles, unless they are hard set in the other styles.
A cell style for a Table Design can contain text formating, background filling and cell border formating.
Operations on Tables
This section documents all the operations a user can apply to tables.
Tables can be inserted with the table slot from either the insert menu or the "Standard", "Insert" or "Table" tool bar. When using the tool bar a drop down floating window opens where the user can select the initial number of columns and rows.
When resizing a table shape the following constrains must be met
- All cells must have at least a minimum with and height
- All cells must be big enough to format and display all its text contents without clipping or over painting their borders.
If the user try to resize a table to a size that can not fulfill the above constrains the application will automatically increase the table shape width and height until all constrains are fulfilled. The application will give priority to the width and will only change height if possible.
If text is added to a cell that does not fit to the width of the cell, automatic line breaking is performed to format the text inside the cells width. If the formatted text still does not fit the cell then the height of the row for that cell is increased until the formatted text fits both the fixed with and the new cell height. If text is removed from a cell and the size of the row is not fixed, the application automatically tries to reduce the height of the row until it has the minimum size to contain the contents of all cells in that row. If as a result of text editing, the height of a row is changed, the height of the table shape is also changed so it exactly fits the new sizes. For tables, quick text editing is always used, regardless of the document settings.
If cells are selected, all columns that contain selected cells are deleted. If no cell is selected, the column with the cell that has the focus is deleted. If there is no selection and no cell has the focus, this operation is disabled. After deletion of columns, the width of the deleted columns is propagated to the remaining columns.
If cells are selected, all rows that contain selected cells are deleted. If no cell is selected, the row with the cell that has the focus is deleted. If there is no selection and no cell has the focus, this operation is disabled. After deleting rows, the height of the deleted rows is subtracted from the height of the table shape.
New columns are inserted right to the current selection. If there is no selection a new column is inserted right to the cell that has the focus. If no selection is available and no cell has the focus, a new column is inserted at the right of the table. If more than one column is selected, the number of inserted columns is the number of selected columns. The width of the inserted columns is equal to the width of the selected columns. After insertion of columns the width of the inserted columns and selected columns is shrinked that the width of all columns still fit into the width of the table shape.
A new row is inserted after the current selection. If there is no selection a new row is inserted before the row with the cell that has the focus. If no selection is available and no cell has the focus, a new row is appended to the last row of the table. If more than one row is selected, the number of inserted rows is the number of selected rows. The newly inserted rows will get the same height as the selected ones. After insertion of rows the height of all inserted rows will be added to the height of the table shape.
All selected cells are merged so that the first cell fills out the space of all other selected cells. All other selected cells become invisible. All text content of the selected cells is added to the first cell. The first cell is the cell in the first selected row and the first selected column. Cells from different rows and columns can be merged, as long as the area defined by the rectangles of all cells contains no cells that will not be part of the merge. For example You can not merge Cell A1 with A3 as the merged rectangle would include A2. You can not merge A1 with A2 and B1 as the merged rectangle includes B2. You can not merge A1 with A2 if A2 is already merged with B2 as the merged rectangle would include B1. If there is no valid selection of more than one cell, this operation is disabled.
If this operation is executed, the “Split Cells Dialog” pops up and asks the user how many new columns and rows he wants for all selected cells. If that dialog is not canceled then all selected cells are split so that they each contain the new number of rows and cells in the same area of the old selected cells. If no cell is selected than this operation is performed only on the cell with the focus. If no cell is selected and there is no cell with the focus then this operation is disabled. If the newly created cells are smaller than the minimum defined cell width or height the table shape is automatically resized to fit the new cells with the minimum width or height. Internally splitting a cell is done by adding new rows and or columns and merging adjacent cells.
Change Row Height
If the user changes the height of a row, this row becomes fixed size. It can't be made smaller than the minimum cell height. If the height of a row is increased, the height of the table shape is also increased to fit the new row height.
Change Column Width
If the user changes the width of a column, the width of the next column will be reduced so that the width of the table stays constant. The width of a column can not be smaller than the minimum cell width. If a columns width can only be increased as long as the next columns width is bigger than the minimum cell width. If the last column is resized, the width of the table is resized to fit the new column width.
Distribute Rows Equally
This operation makes all rows the same height. This is the height of the table shape divided by the number of rows.
Distribute Columns Evenly
This operation makes all columns the same width. This is the width of the table shape divided by the number of columns.
This operation adds all cells in one row to the current selection.
This operation adds cells in one column to the current selection.
This operation adds one cell to the current selection.
The keyboard interactions specified here are taking from observing the current keyboard interactions for tables in OpenOffice.org Writer. All keys not specified below will be used as normal text input and will be inserted at the position of the text cursor. If no cell has a focus, the first cell will become the focus.
If a cell has the focus, the cursor keys are used to travel the text cursor in the containing text. If not text is contained or the start or end of the text is reached, the focus will be transferred to the corresponding adjacent cell, if available.
Travels the text cursor towards the beginning of the text in a cell, character by character. If no cell text is available or if the cursor is already at the beginning of the text, the focus is moved to the first visible cell left of the cell with the focus. If the cell with the current focus is the first visible cell in that row, the focus is transferred to the last visible cell in the previous row, if available.
Travels the text cursor towards the end of the text in a cell, character by character. If no text is available or if the text cursor is already at the end of the text, the focus is moved to the first visible cell in the same row after the cell with the focus, if available.
Travels the text cursor towards the begin of the text, line by line. If no text is available or if the text cursor is already at the begin of the text, the focus is moved to the cell in the prior row that is adjacent to the cell with the focus, if available.
Travels the text cursor towards the end of the text, line by line. If no text is available or if the text cursor is already at the begin of the text, the focus is moved to the cell in the next row that is adjacent to the cell with the focus, if available.
Cursor keys and modifier key STRG
Only cursor left and cursor right are supported with this modifier. Behavior is the same, except text is traveled word by word instead of character by character.
The focus is moved to the next visible cell in the the row with the cell that contains the focus. If there are no more visible cells in that row, the first visible cell in the next row gets the focus, if available. If there is no selection and no focus, nothing happens. If the tab key is used in the last visible cell of the last row, the operation “Insert Below” will be executed and the focus will be set to the first cell in the newly created row.
If there is an active selection, the selection is changed that the focused cell now is a border of the selection rectangle.
If the modifier SHIFT is used, the focus is moved to the previous visible cell in the the row with the cell that contains the focus. If there are no more visible cells prior to the cell with the focus in that row, the last visible cell in the previous row gets the focus, if available. If there is an active selection, the selection is changed that the focused cell now is a border of the selection rectangle.
If there is a text cursor, it is placed at the beginning of the text from the cell with the focus.
If the modifier STRG is used, the focus is set to the first cell.
If there is a text cursor, it is placed at the end of the text from the cell with the focus.
If the modifier STRG is used, the focus is set to the last cell.
The character before the text cursor is deleted. If there are no characters before the text cursor, the focus is moved to the previous visible cell in the same row as the cell with the focus. If there is no previous visible cell in the same row, the last visible cell in the previous row will be used, if available. If the focus changes to another cell, the text cursor is placed at the end of the text in that cell.
If the modifier STRG is used, whole words are deleted instead of single characters.
The character at the text cursor is deleted. If there are no characters at the text cursors, the focus is moved to the next visible cell in the same row as the cell with the focus. If there is no next visible cell in the same row, the first visible cell in the next row is used, if available.
If the modifier STRG is used, whole words are deleted instead of single characters.
A key and modifier STRG
If the cell with the focus contains text, the whole text of that cell is selected. If it is already selected or if there is no cell containing the focus, all cells are selected. If the cell with the focus contains no text, all cells are selected.
Selection and the modifier key SHIFT
All keys used for traveling can be combined with the modifier key SHIFT. In that case an existing selection is expanded to the cell with the focus. If no selection is available a new selection is spawned from the cell with the initial focus. Traveling inside text spawns a text selection. As soon as cells are selected or a text selection is spawned across cell borders, only whole cells will be traveled and selected.
If selected, a table shape becomes a border and handles for translation and resizing.
Setting the focus
When the user clicks in the left border area of a cell, the whole cell is selected. When the user clicks inside a cell text area, the focus and text cursor is placed inside that cell. If the click was made inside text in a cell, the text cursor is placed directly at this position. If the table shape does not yet have the focus, it will get the focus and text edit will become active.
Right click into the table will set focus to the cell under the mouse pointer and create a context menu. If the text engine can provide a context menu for the given text selection or for the text under the mouse position, this context menu will be used. If not, the table shape context menu is shown (see 1.11).
Resizing Row Height
If the mouse is near the border between two rows, the mouse pointer will change to reflect that resizing the row height is now possible. When the user press the left mouse button, horizontal changes of the mouse will result in resizing the row height. See 1.7.11 for constrains.
Resizing Column Width
If the mouse is near the border between two rows and both the cell left and right to the mouse are not merged together, the mouse pointer will change to reflect that resizing the column width is possible. When the user press the left mouse button, vertical changes of the mouse will result in resizing the column width. See 1.7.12 for constrains.
Mouse selection starts when the user mouse button is pressed down inside a cell and then the mouse is moved to another cell without releasing the mouse button. After releasing the mouse button, all cells in the rectangle formed by the cell where the mouse was pressed and the cell where the mouse was released will become selected.
Table Design Panel
The Table Design Panel is placed in the task pane in impress between the Layouts and the Custom Animations panels.
This section contains a value set with the available predefined table styles. The preview of the table styles is rendered according to the currently active table style options. Selecting one of the table styles while a table shape is selected assigns the table style to the table shape. When a table style is assigned in this way, all hard formating attributes will be removed from the table shape. If a table style is selected and there is no table shape selected than the #Insert Table dialog will pop up and a new table is inserted with the selected table style.
This is the second section in the Table Design task pane. It contains check boxes select what part of the table style is used to format a table shape.
If checked, all cells of the first row are using the header row formating from the table style
If checked, all cells in the last row are using the total row formating from the table style
If checked, all cells from even rows are using the even horizontal banding formating from the table style. This excludes all cells that are affected from one of the layout properties defined above.
If checked, all cells in the first column are using the first column formating from the table style. This excludes all cells that are affected from one of the layout properties defined above.
If checked, all cells in the last column are using the last column formating from the table style. This excludes all cells that are affected from one of the layout properties defined above.
If enabled, all cells from even columns are using the even vertical banding formating from the table style. This excludes all cells that are affected from one of the layout properties defined above.
Table Design Dialog
The table design dialog is shown in draw when the entry Table Design from the table toolbar is executed. Since draw does not feature a task pane, the contents of the Table Design Panel is shown in this dailog to support this feature in draw also. The strings and resources are the same from the Table Design Panel.
Insert Table Dialog
The Insert Table dialog lets the user select the initial number of rows and columns for new table shapes.
|Label||~Number of columns:||en-US|
|Label||Number ~of rows:||en-US|
Split Cells Dialog
The “Split Cells” dialog from the OpenOffice.org Writer application will be used.
The Table toolbar is a context sensitive toolbar and is shown if exactly one table shape is selected.
- Insert Table
- Line Style -> Style: DropDownOnly
- Line Color (of the border) Style: DropDownOnly
- Border Style: DropDownOnly
- Background Color Style: DropDownOnly
- Merge Cells
- Split Cells
- Optimize --> Optimize Style: DropDownOnly
- Distribute Columns Evenly
- Distribute Rows Equally
- Insert Row
- Insert Column
- Delete Row
- Delete Column
- Select Table#
- Select Columns#
- Select Rows#
- Table Design
- Table Properties
|Item||Line Color (of the border)||en-US|
|Item||Background Color Style||en-US|
|Item||Center ( vertical )||en-US|
If a table shape or a range of selected cells are placed into clipboard, the format RTF for paste special.
From impress/draw to impress/draw
If the table shape is selected and copied to the clipboard, default pasting creates a clone of the copied table. If the table shape had selected cells, a table shape with only the selected cells is inserted. If during paste operation the focus is inside a table shape or if a table shape is selected with a cell selection, the contents of the table cells in clipboard are inserted into the selected table shape.
From impress/draw to writer/calc
When pasting a table shape into writer or calc, the RTF format will be used so that the cells are inserted.
Migrating old tables
Existing content where user draw their tables using shapes or the OpenOffice.org Calc application can not be converted to native tables. The user will have to re create the table and copy the textual contents to the new table via clipboard. The same applies to tables imported from Microsoft Powerpoint in versions that did not support native tables as the resulting group shape does not contain any information to re create the original table.
Loading new tables in older versions of OpenOffice.org
Older versions of OpenOffice.org that do not contain the feature of native tables in impress will not be able to work with the new tables as described in this specification. Older versions will load the new tables as vector graphic files. Therefore editing of the table contents will not be possible. If the older version saves documents that contained native tables the original tables will be lost and converted to vector graphic files, even if later loaded by newer versions.
<START TYPING HERE --- If this part is irrelevant state a reason for its absence.>
<START TYPING HERE --- If this part is irrelevant state a reason for its absence.> Help
<State a bulleted list of issues Issue here>