Follow text flow vs. leaving layout environment

for Writer fly frames

MS-Interoperability

Document - ID	Specification Owner	Last Change	Status
	Oliver-Rainer Düsterhöft	11/19/2003	Final
Conforms to	
Applies to	OpenOffice Writer
Task ID(s)	IssueZilla task 18732
Category	Feature

Abstract

Writer can now have vertical aligned objects that are anchored to page. Objects in this case are frames, OLE objects, graphics and drawing objects.

This feature allows to fully support import and export of MS Word documents with such positioned and aligned objects in it as well as this feature eases the migration from Word to Writer by giving the user a well-known feature at hand.

i-Team Members

	Name	E-mail Address
Specification Owner	Oliver-Rainer Düsterhöft (OD)	oliver-rainer.duesterhoeft@sun.com
User Experience	Falko Tesch (FT)	falko@sun.com
Development	Oliver-Rainer Düsterhöft (OD)	oliver-rainer.duesterhoeft@sun.com
Quality Assurance	Michael Rüß (MRU)	michael.ruess@sun.com
Documentation	Uwe Fischer (UFI)	uwe.fischer@sun.com

Approved for Implementation

	Approved by	Date
User Experience	Falko Tesch	11/07/2003
Development	Andreas Martens	11/06/2003
Quality Assurance	Stefan Baltzer	11/14/2003
Documentation	Uwe Fischer	11/10/2003
String Review	Elizabeth Matthis (EM)	11/19/2003

Document Change History

Rev. Level	Change	Initials	Date
1.0	Initial version	OD	10/16/2003
1.1	including FT's adjustments and add clarifications due to FT's comments	OD	11/06/2003
1.2	add FT's approval	OD	11/10/2003
1.3	including EM's corrections; add EM's approval	OD	11/19/2003

Contents

Glossary	1

1	Motivation	1

2	User Scenarios	1

3	Goals	2

4	Requirements and Dependencies	2

4.1	Requirements	2

4.2	Technical Dependencies	2

5	Competitive Analyses	2

6	Detailed Specification	2

6.1	New option 'Follow text flow'	2

6.2	Influence of new option on the formatting	4

6.3	Default value of the new option	4

6.4	Using new option in MS Word import filter	5

6.5	Error Conditions	5

7	Future Tasks	5

8	Legal Issues	5

9	Notes	5

10	References	5

Glossary

Term	Description
floating screen object	This term denotes the objects 'Writer fly frame' and 'drawing object' in Writer and the objects 'text box', 'graphic', 'frame', 'picture' etc. in MS Word.
Writer fly frame	A floating screen object containing normal Writer content (text, tables, sections, columns, etc.), graphics, or OLE content.
drawing object	A floating screen object from the draw application – e.g. rectangles, circles, lines, arrows, etc.
anchor [of a floating screen object]	A tool that links the floating screen object to a defined content. In Writer this could be a paragraph, a character, a page, or a Writer fly frame. In MS Word this can only be a character.
layout environment [given by an anchor]	Surrounding environment the anchor is in. If the anchor is a paragraph or a character this could be the document body, a table cell, a footnote/endnote, the page header/footer, or a Writer fly frame. If the anchor is a page or a Writer fly frame, its the page respectively the Writer fly frame.

Motivation

MS Word and Writer have different approaches on anchoring and positioning objects in documents. To enhance interoperability in between these products as well as to lower the threshold for users to migrate to from Word to Writer it is mandatory to adapt certain behaviour from Word and integrate it into Writer. To control if a Writer fly frame can follow the text flow or if it is allowed to leave its given layout environment is addressed in this specification.

User Scenarios

Scenario 1

Interoperability: A user gets a Word document and opens it within Writer. The person who designed the Word document made heavy use of objects of any kind in his text.

Thus the layout of the Word document relies heavily on the precise interpretation of position of the inserted objects.

Since Word has only one single anchor point it compensates this by various possibilities to position the object within the document.

Once this specification is implemented the user will have less layout loss in this case when importing and if course exporting the document into/from Writer.

Scenario 2:

Migration: A user who is used to work with MS Word will only know how to position objects in text documents but will for the beginning at least hardly know anything about anchoring (which is heavily used in Writer). Therefore this user will at the beginning try to insert and position objects in his Writer documents the way MS Word allows.

To accomplish and to ease such transition this specification will enhance the usability for such migrating users by offering similar positioning features in Writer (w/o EOL existing ones).

Goals

Implement a new option for Writer fly frames, by which it can be controlled, if the Writer fly frame will follow the text flow or will leave its layout environment, to improve the interoperability of the Writer to MS Word.

Requirements and Dependencies

Requirements

None

Technical Dependencies

Not known.

Competitive Analyses

The competitive analyses will consider MS Word only since this specification is about MS interoperability. Since the Detailed Specification is based on a direct comparison that need to be implemented a competitive analyses is not needed.

Detailed Specification

Note: The following descriptions are given for a horizontal layout, in which the text flows from top to bottom. For a vertical layout, in which the text flows from right to left, you have to convert the corresponding terms.

New option 'Follow text flow'

We will introduce the new option 'Follow text flow' for Writer fly frames. The value of the option influences the vertical position of a Writer fly frame and also its horizontal position – for further details see below. The value of the option can be changed in the dialog for Writer fly frames on pane 'Type'.

Illustration 1 Type tab page of Frame dialogue box

If the option is ON, the Writer fly frame will be formatted as in Writer in OpenOffice 1.1.

Import of documents in an older file format

For documents in an older file format that are imported in the new version of the Writer, the option is ON for all Writer fly frames. The default will also be ON.

Export of documents to an older file format

Exporting new documents with Writer fly frames that have the option OFF, to an older file format will result in a loss of this information, because it's not supported in the older file formats. Thus, if such exported documents are loaded in an older version of the Writer, the Writer fly frames are formatted as the option would be ON. In a new version of the Writer such exported documents will be imported as stated in the previous subchapter.

String list

Item	English	German	Comments
Checkbox	Follow text flow	Textfluss folgen	TRANSLATION:Use text corresponding to the text under Format – Paragraph – “Text Flow”; String of new checkbox in dialog of Writer fly frames, pane 'Type' at the end of the area, which is named by 'Position'; found under Insert – Frame – Type tab page.

Tab Order

No changes in existing tab order

Key Board Shortcuts

No new keyboard shortcuts needed

Influence of new option on the formatting

Exceeding layout environment at the bottom

The given positioning attributes could cause a Writer fly frame to its given layout environment at the bottom by using values that are much bigger than the page size..

If option “Follow text flow” is ON, the next layout environment in the text flow is searched and the Writer fly frame is positioned inside the found layout environment. Thus it can happen that the Writer fly frame is positioned on the next page. The position of the Writer fly frame is then calculated as if its positioned inside a layout environment which has the size of both layout environments. If no next layout environment in the text flow exists – normally for page headers/footers, Writer fly frames, or table cells – the position and (if needed) its size is adjusted. This way the Writer fly frame fits to its layout environment which is given by its anchor. A special case is performed if the layout environment is a table cell – before the position (and size) of the Writer fly frame is adjusted the table cell will extend its size to its limits.

If option “Follow text flow” is OFF the Writer fly frame is allowed to leave its given layout environment. But the Writer fly frame will stay on the page, its anchor is positioned in. Thus it can happen that a Writer fly frame anchored at a paragraph inside its page header is positioned in the area of the document body.

Exceeding layout environment at the top

Like above the given positioning attributes could cause also that a Writer fly frame would exceed its given layout environment at the top.

If the option is ON the Writer fly frame is positioned at the top of the given layout environment.

If the option is OFF the Writer fly frame is allowed to leave its given layout environment. But the Writer fly frame will stay on the page where its anchor is positioned in. Thus it can happen that a Writer fly frame which is anchored at a paragraph inside the document body is positioned in the area of the document page header.

Exceeding layout environment at the left respectively the right

Again the given positioning attributes could cause a Writer fly frame to exceed its given layout environment to the left or the right.

If the option is ON the Writer fly frame is allowed to leave the layout environments document body, column, page header/footer and/or footnote/endnote. But the Writer fly frame isn't allowed to leave the layout environment's table cell and Writer fly frame. In these layout environments the Writer fly frame is captured.

If the option is OFF it can leave all types of layout environments that can be defined by its anchor. Example: Thus it can happen that a Writer fly frame that is anchored at a paragraph inside a table cell of the first table row is positioned in the area of the third table cell in the second table row.

Default value of the new option

For new documents the default value of the new option will be OFF. The default value will be saved in the document.

For open documents the default value is taken from the document file. If no saved value is found in the document file – in general for documents from previous versions of OpenOffice – the default value will be ON.

For imported MS Word document the default value will be OFF – as for new documents.

Exporting documents to MS Word file format will result in a loss of the information for Writer fly frames that have the option ON, because MS Word doesn't support something like 'following the text flow'.

Using new option in MS Word import filter

As stated in the previous subchapter the default value of the new option will be OFF. This is the right value for the most imported floating screen objects.

An exception has to be made for floating screen objects which are anchored inside a table cell and which hasn't got the MS Word wrapping modes 'in front of text', 'behind text', or 'tight' set. For these floating screen object the value of the new option at the corresponding object in the Writer will be set to ON.

Error Conditions

Not known

Future Tasks

In order to improve the interoperability for MS Word floating screen objects completely, the following adjustments have to be specified and implemented:

Considering the wrapping mode of a floating screen object in the area outside its given environment. This needs some re-work in the layout engine to avoid loops caused by the fact that the anchor position can now be influenced by the position of the Writer fly frame an vice versa.

Layout algorithm for floating screen objects as MS Word applies it to its floating screen objects for imported documents. MS Word seems to calculate a position of a floating screen object as it has the wrapping mode 'wrap through' set without reflecting of a changed anchor position by a negative positioned floating screen object. For this full understanding of MS Word layout algorithm and a compatibility flag is needed.

Legal Issues

Not know

Notes

References

Required - Give references to related documentation, such as engineering designs, technical specs, and other sources for related units. Also include links to documents that other sections in this spec need to refer to, such as user opinions usability test reports.

Follow text flow vs. leaving layout environment for Writer fly frames

Page 6

spec-FollowTextFlow-v1.3-approved.sxw

Follow text flow vs. leaving layout environment for Writer fly frames

Oliver-Rainer Düsterhöft

2003-10-15T15:18:36