Other Drawing-Specific View Settings

From Apache OpenOffice Wiki
Jump to: navigation, search

Drawings and presentations can be switched to certain view modes. This is done by the following drawing-specific controller properties of com.sun.star.drawing.DrawingDocumentDrawView:

Properties of com.sun.star.drawing.DrawingDocumentDrawView
IsLayerMode boolean - Switch to layer mode.
IsMasterPageMode boolean - Switch to master page mode.
CurrentPage com.sun.star.drawing.XDrawPage - This is the drawing page that is currently visible.

Furthermore, there are many properties that can be changed through the XViewDataSupplier interface of the document:

Methods of com.sun.star.document.XViewDataSupplier:

  com::sun::star::container::XIndexAccess getViewData()
  void setViewData( [in] com::sun::star::container::XIndexAccess aData)

To use ViewData properties, call getViewData() and receive a com.sun.star.container.XIndexContainer:

Methods of XIndexContainer:

  type getElementType()
  boolean hasElements()
  long getCount()
  any getByIndex( [in] long Index)
  void replaceByIndex( [in] long Index, any Element)
  void insertByIndex( [in] long Index, any Element)
  void removeByIndex( [in] long Index)

Use getByIndex() to iterate over the view data properties, find the required com.sun.star.beans.PropertyValue by checking the property names. If found, set the Value Member of the property value and put it back into the container using replaceByIndex(). Finally, apply the whole ViewData container to the document using setViewData().

The method setViewData() is currently not working. It can only be used with loadComponentFromURL().

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