Calc Cell Property “Diagonal Borders”

OpenOffice.org 2.0

Document - ID	Specification Owner	Last Change	Status
	Daniel Rentz	2004-06-14	Final
Conforms to	StarOffice Specification Workflow v0.1, Aug 2003
Applies to	Calc, API
Task ID(s)	i8396, i23674, i23675, i23676, i23677, i23678
Category	Feature

Abstract

To increase compatibility to Microsoft Excel, Calc needs support for diagonal borders in spreadsheet cells. Additionally to real cell borders left, right, above, and below a cell, diagonal borders can cross the cell contents. The two possible lines can be shown and formatted independent from each other.

This specification will define how Calc will implement this feature.

i-Team Members (The specification owner is part of the i-Team)

	Name	E-mail Address
Specification Owner	Daniel Rentz (dr)	daniel.rentz@sun.com
User Experience	Falko Tesch (ft)	falko@sun.com
Development	Daniel Rentz (dr)	daniel.rentz@sun.com
Quality Assurance	Oliver Crämer (oc)	oliver.craemer@sun.com
Documentation	Frank Peters (fpe)	fpe@sun.com

Approved for Implementation

	Approved by	Date
User Experience	Falko Tesch	2004-04-13
Development	Daniel Rentz	2004-01-06
Quality Assurance	Oliver Crämer	2004-04-22
Documentation	Uwe Fischer (ufi)	2004-04-23
String Review	Elizabeth Matthis (liz)	2004-06-14

Document Change History

Rev. Level	Change	Initials	Date
1.0	Initial version	dr	2004-01-08
1.1	More user scenarios; default border styles	dr	2004-03-10
1.2	Reviews	ft/oc/ufi	2004-04-23
1.3	String review -> Final	liz	2004-06-14

Contents

1	Motivation	1

2	User Scenarios	1

3	Goals	1

4	Requirements and Dependencies	1

4.1	Requirements	1

4.2	Technical Dependencies	1

5	Competitive Analyses	2

5.1	Microsoft Excel	2

5.2	KSpread	2

5.3	Gnumeric	3

5.4	Lotus 1-2-3	3

6	Detailed Specification	4

6.1	Functionality	4

6.2	User Interface	4

6.2.1	Design of the Control	5

6.2.2	Mouse Handling	6

6.2.3	Keyboard Handling	7

6.2.4	Default Border Styles	7

6.2.5	String List	8

6.2.6	Tab Order	8

6.2.7	Keyboard Shortcuts	8

6.3	G11n	8

6.4	Error Conditions	9

7	Future Tasks	9

8	Notes	9

9	References	9

Glossary

Term	Description
<Term 1>	

Motivation

Enhancing Ease-of-Use as well as easing the learning curve for MS Excel users and enhancing the user's abilities to use their MS Excel documents.

User Scenarios

A user that enabled this feature in Excel will get different results on his spreadsheet layout when opening his spreadsheet in Calc.

Another user who migrates from Excel to Calc might be used to format his cells with diagonal lines and will not find this feature in Calc. This will raise the reluctance to switch and adopt Calc in his day-to-day work.

Goals

Interoperability with MS Excel documents.

Ease-of-Use with Excel. It is mandatory that the users finds a comparable interface within the same interface structure as in Excel.

Consistency. Although this feature should be Excel-user compatible it must fit seamlessly into the existing Calc user interface and naming conventions/glossary.

Requirements and Dependencies

Requirements

This feature will allow users to easily adopt their skills on working with MS Excel spreadsheets to migrate to Calc.

Technical Dependencies

None.

Competitive Analyses

Microsoft Excel

Microsoft Excel 97 (and later) supports diagonal lines in the “Format – Cells – Border” tab page:

Illustration 1: The Border tab page in Microsoft Excel It is possible to switch on/switch off the lines independent from each other, buth it is not possible to format them in a different way. If both lines are visible, they always have the same color and style.

KSpread

KSpread 1.2.1 supports diagonal border lines. Its border dialog is similar to the dialog of Excel.

Illustration 2: The Border tab page in KSpread

Gnumeric

Gnumeric 1.2.x supports diagonal border lines. Its border dialog is similar to the dialog of Excel.

Illustration 3: The Border tab page in Gnumeric Lotus 1-2-3

Lotus 1-2-3 97 does not support diagonal border lines.

Detailed Specification

Functionality

Diagonal border lines in spreadsheet cells may be useful to layout the top left cell(s) of a table header:

Illustration 4: Sample of diagonal borders in a spreadsheet In the sample above the two cells A1 and B2 contain a border line from top left edge to bottom down edge. Additionally it will be possible to set a border line from bottom left edge to top right edge. Both lines can be formatted independent from each other (color and style). Diagonal border lines will be part of direct cell formatting and of cell styles.

Diagonal lines will not be painted at all, if the cell contents are rotated, except for the rotation angles 90 degrees, 180 degrees, and 270 degrees. This is done to keep compatibility to MS Excel.

User Interface

The border control box in the “Format – Cell – Borders” tab page has to be extended to handle diagonal lines. This control will continue to support the absence of diagonal lines, used i.e. for tables in text documents.

Illustration 5: Old “Format – Cells – Borders” tab page

Design of the Control

The following examples show the design of the border control box. It differs dependent on the size of the cell range the dialog has been invoked from. Additionally, the control has been redesigned slightly to a clearer and simpler look. Note that for cell ranges the same diagonal lines are displayed repeatedly.

Single cell	One column, multiple rows *)	One row, multiple columns *)	Multiple rows and columns
*) The representation of 1-dimensional cell ranges (one column with multiple rows, or one row with multiple columns) is new for this control.

The Selection Arrows

Illustration 6: Detailed design of the arrows and markers The current selection is shown with little black arrows (as shown above). As before, using the line style box or the color list box affects all lines that are currently selected.

The Line Styles

The old contol was very restricted in displaying the current line style. A single line was represented either by a thin (1 pixel) or thick (3 pixels) line, regardless of its real width. Similar, for all double lines only 2 different representations were available.

The new control will draw the lines more realistic. It maps the width of the lines to pixels on the screen (i.e. the 4 pt line is drawn with a width of 4 pixels).

Mouse Handling

The general usage of the control will not change. The following tables show how mouse clicks are handled in different areas of the border control box.

Selection of Outer Border Lines

Single cell	One column, multiple rows	One row, multiple columns	Multiple rows and columns
Red areas activate the respective single outer border line. Blue areas activate the horizontal and vertical line of the respective corner.

Selection of Inner Horizontal or Vertical Lines

Single cell	One column, multiple rows	One row, multiple columns	Multiple rows and columns
Red areas activate the respective single inner border line. Blue areas activate an inner line and the respective outer line; or both inner lines.

Selection of Diagonal Lines

Single cell	One column, multiple rows	One row, multiple columns	Multiple rows and columns
Red areas activate the top-left to bottom-right border line. Green areas activate the bottom-left to top-right border line. Blue areas activate both diagonal lines.

Keyboard Handling

Keyboard navigation inside the control needs a few extensions to include the diagonal lines. It will be possible to reach all border lines with the cursor keys. The old behaviour is that the LEFT/RIGHT cursor keys reach the 2 or 3 vertical lines, and the UP/DOWN cursor keys reach the 2 or 3 horizontal lines. The diagonal lines will be inserted into the chains for both directions. The following table shows in which order the lines are used.

Cursor keys	Single cell	One column, multiple rows	One row, multiple columns	Multiple rows and columns
LEFT/RIGHT	Outer left Top-left to bot-right Bot-left to top-right Outer right	Outer left Top-left to bot-right Bot-left to top-right Outer right	Outer left Top-left to bot-right Inner vertical Bot-left to top-right Outer right	Outer left Top-left to bot-right Inner vertical Bot-left to top-right Outer right
UP/DOWN	Outer upper Top-left to bot-right Bot-left to top-right Outer lower	Outer upper Top-left to bot-right Inner horizontal Bot-left to top-right Outer lower	Outer upper Top-left to bot-right Bot-left to top-right Outer lower	Outer upper Top-left to bot-right Inner horizontal Bot-left to top-right Outer lower

The SPACE bar sets the current style and color to the selected line(s) or clears it (them) as before.

Default Border Styles

The dialog offers 5 predefined border styles. These styles have to be extended for the new possible states “no horizontal inner line available”, “no vertical inner line available”, and “diagonal lines available”. The following table shows all predefined styles the dialog will support:

Dialog state	Supported predefined styles
Single cell without diagonal lines	
Single cell with diagonal lines	
One column, multiple rows	
One row, multiple columns	
Multiple rows and columns	

String List

Item	English	German	Comments
Tooltip Help Texts			
	Set No Borders	Keine Umrandung zeichnen	Existing
	Set All Four Borders	Komplette Umrandung zeichnen	Existing
	Set Left and Right Borders Only	Nur rechten und linken Rand zeichnen	Existing
	Set Top and Bottom Borders Only	Nur oberen und unteren Rand zeichnen	Existing
	Set Left Border Only	Nur linken Rand zeichnen	Existing
	Set Outer Border Only	Nur äußere Umrandung zeichnen	Existing
	Set Outer Border and Horizontal Lines	Äußere Umrandung und horizontale Linien zeichnen	Existing
	Set Outer Border and All Inner Lines	Äußere Umrandung und alle inneren Linien zeichnen	Existing
	Set Outer Border Without Changing Inner Lines	Äußere Umrandung zeichnen, ohne innere Linien zu verändern	Existing; Missing comma in German (red)
	Set Diagonal Lines Only	Nur diagonale Linien zeichnen	New
	Set Top and Bottom Borders, and All Horizontal Lines	Oberen und unteren Rand und horizontale Linien zeichnen	New
	Set Left and Right Borders, and All Vertical Lines	Linken und rechten Rand und vertikale Linien zeichnen	New
Accessibility			
Accessibility title for the top-left to bottom-right border line	Diagonal border line from top left to bottom right	Diagonale Umrandungslinie von oben links nach unten rechts	
Accessibility title for the bottom-left to top-right border line	Diagonal border line from bottom left to top right	Diagonale Umrandungslinie von unten links nach oben rechts	

Note that the accessibility descriptions for all old border lines are equal to the accessibility titles. This will also apply for the new diagonal lines.

Tab Order

No changes in tab order.

Keyboard Shortcuts

No new keyboard shortcuts added.

G11n

The control will not be mirrored in Right-To-Left environments.

Error Conditions

No error conditions.

Future Tasks

None.

Notes

None.

References

OpenOffice.org issue: http://www.openoffice.org/issues/show_bug.cgi?id=8396

PCD-ID: MSInteroperability-8

Screenshot source: http://www.koffice.org/kspread/screenshots.php

Screenshot source: http://www.gnome.org/projects/gnumeric/screenshots.shtml

Calc Cell Property “Diagonal Borders”

Page 9

http://specs.openoffice.org/calc/compatibility/diagonalborders.sxw

Calc Cell Property “Diagonal Borders”

Matthias Müller-Prove

2004-01-06T15:39:55