Settings

From Apache OpenOffice Wiki
Jump to: navigation, search



General Document Information

Text documents offer general information about the document through their com.sun.star.document.XDocumentPropertiesSupplier interface. The DocumentProperties is a common Apache OpenOffice feature and is discussed in Office Development.

The XDocumentPropertiesSupplier has one single method:

 com::sun::star::document::XDocumentProperties getDocumentProperties()

which returns a com.sun.star.document.DocumentProperties service, offering metadata and statistical information about the document that is available through File - Properties in the GUI.


Documentation note.png In OpenOffice.org versions before 3.0, use the interface com.sun.star.document.XDocumentInfoSupplier instead.

Document Properties

The model implements a com.sun.star.beans.XPropertySet that provides properties concerning character formatting and general settings.

The properties for character attributes are CharFontName, CharFontStyleName, CharFontFamily, CharFontCharSet, CharFontPitch and their Asian counterparts CharFontStyleNameAsian, CharFontFamilyAsian, CharFontCharSetAsian, CharFontPitchAsian.

The following properties handle general settings:

Properties of com.sun.star.text.TextDocument
CharLocale com.sun.star.lang.Locale. Default locale of the document.
CharacterCount long - Number of characters.
ParagraphCount long - Number of paragraphs.
WordCount long - Number of words.
WordSeparator string - Contains all that characters that are treated as separators between words to determine word count.
RedlineDisplayType short - Displays redlines as defined in com.sun.star.document.RedlineDisplayType.
RecordChanges boolean - Determines if redlining is switched on.
ShowChanges boolean - Determines if redlines are displayed.
RedlineProtectionKey sequence < byte >. Contains the password key.
ForbiddenCharacters com.sun.star.i18n.ForbiddenCharacters. Contains characters that are not allowed to be at the first or last character of a text line.
TwoDigitYear short - Determines the start of the range, for example, when entering a two-digit year.
IndexAutoMarkFileURL string - The URL to the file that contains the search words and settings for the automatic marking of index marks for alphabetical indexes.
AutomaticControlFocus boolean - If true, the first form object is selected when the document is loaded.
ApplyFormDesignMode boolean - Determines if form (database) controls are in the design mode.
HideFieldTips boolean - If true, the automatic tips displayed for some types of text fields are suppressed.

Creating Default Settings

The com.sun.star.lang.XMultiServiceFactory implemented at the model provides the service com.sun.star.text.Defaults. Use this service to find default values to set paragraph and character properties of the document to default.

Creating Document Settings

Another set of properties can be created by the service name com.sun.star.document.Settings that contains a number of additional settings.

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages