Reveal Codes

Try the demo

Have the cursor in desired paragraph then click this button .

Demo paragraph bold italic boldItalic boldedFromToolbar underlined redlining regular text 10/06/04.

That's using it at it's simplest. What follows is some detail about each of the controls on the dialog. These instructions are a little contrived to provide lots of headings to experiment with.

The controls on the dialog

Paragraph / Text Portions radio controls

These allow you to display either the whole paragraph or text portions. With Paragraph selected you will be able to reset direct attributes applied to the whole paragraph. With Text portions selected you will be able to reset direct attributes applied to the a selected text portion.

Paragraph left Text Box

This simply displays the entire paragraph with its fields in a similar fashion to WordPerfect's reveal codes. Codes are enclosed in angle brackets and the closing code starts with a slash “/”. I haven't yet figured out how (or if) I can colour code the fields. I am also interested in what functionality people would like from here. Producing this text is what slows the macro down considerably so if it is a waste of time I would like to know that too.

Text Portion left List box

In Writer a paragraph is made up of text portions. A portion being a block of text with the same formatting, or some special feature like a frame. I have tried to represent the text portions in such a way as to be able to readily identify them from your document. Clicking on a portion will select that portion in the document as well. Select a portion so that you can see that portion attributes in the right list box.

Attribute List Box

Lists the directly applied attributes of the current paragraph. It is a multi-select list box so you can use Ctrl and shift to select more than one attribute. I haven't worked out a good way of displaying constants and enumerations – what this means is that the direct attributes display numbers rather than more descriptive text. E.g. Currently displays “ParaAdjust = 1” rather than “ParaAdjust = Right aligned”.

Reset

Sets the selected attribute(s) to default.

Prev Paragraph

Changes to the previous paragraph. I have been a bit slack and not disabled the control if there isn't a previous paragraph, it will simply stay on the first paragraph.

Next Paragraph

Changes to the next paragraph. I have been a bit slack and not disabled the control if there isn't a next paragraph, it will simply stay on the last paragraph.

Close

Close the dialog.

Dialog font size

Select or type the desired font size for the dialog. It only effects the dialog.

Speed issues

The more text portions there are the slower the macro is at displaying the codes. I haven't figured out how to speed this up.

Installing

This macro is very much in the development stage so it probably isn't worth installing yet.

Adding the library

This is so that the macro will be available for use when required

Tools > Macros > Macro... > Organizer > Libraries

Ensure that sOffice is selected for Application/Document

Click Append...

Navigate to where this file is stored and select it, click Open

Uncheck “Standard” but ensure “RevealCodes” is checked

If updating from an old version check “Replace existing libraries”

OK > Close > Close

Adding a menu entry

This is so that the macro integrates with OpenOffice.org Writer so that it appears seamlessly a part of it.

Tools > Configure... > Menu

Select desired location in the top list box (“~Nonprinting Characters” is probably a good place)

In the category list box: Click the + next to “OpenOffice.org BASIC Macros” (towards bottom of list), the plus next to “RevealCodes”, then click “RevealCodes”.

In the function list box: Click “IannzRevealCodes”

Click the New button (top right of dialog)

Click OK

Copyright

Copyright © 2004 Ian Laurenson

Anyone may run the code associated with this document. If you wish to modify or distribute this document and or its code, then you are granted a license to do so under the terms of the Gnu Lesser General Public License. See: http://www.gnu.org/licenses/lgpl.html.

Author contact

Send comments, bug fixes, change requests etc to hillview@paradise.net.nz

Example footnote.

2004-06-10T22:48:35