OO-Snippets: Hide Annotations

Commons

Keywordsannotation, hide annotation, annotations
LanguageooRexx
ApplicationWriter
AuthorsMatthias Prem (initial)
Supported Versions
Supported OSAll  
QuestionHow can I hide existing annotations?
Answer

Code-Snippet-Listing (snippet-source)

/* HideAnnotations.rex */
/* Macro */
/* hide existing annotations */

/* get the script context and the desktop */
xScriptContext=uno.getScriptContext()
xDesktop=xScriptContext~getDesktop

/* get the current component (the Writer) and the controller from the xModel */
xComponent = xDesktop~getCurrentComponent()
xModel = xComponent~xModel
xController = xModel~getCurrentController()

/* the XViewSettings is part of the xSelectionSupplier */
xSelectionSupplier = xController~XSelectionSupplier
xViewSettingsSupplier = xSelectionSupplier~XViewSettingsSupplier
xViewSettings=xViewSettingsSupplier~ViewSettings

/* get the property set for the current view and hide the annotations*/
xViewProperties = xViewSettings~XPropertySet
xViewProperties~setPropertyValue("ShowAnnotations", box("boolean", .false))

::requires UNO.CLS

Changelog

DateUserModification
2006-07-10matthiaspremInitial version

and