• No se han encontrado resultados

C) Stuart Hall

6. Colonialismo interno, modernidad/colonialidad

6.1. Los intelectuales decoloniales

A table consists of individual rows. These in turn contain the various cells. Strictly speaking, there are no table columns in StarOffice. These are produced implicitly by arranging the rows (one under another) next to one another. To simplify access to the tables, StarOffice, however, provides some methods which operate using columns. These are useful if no cells have been merged in the table. Let us first take the properties of the table itself. These are defined in the

com.sun.star.text.TextTable service. Here is an list of the most important properties of the table object:

BackColor (Long)– background color of table.

BottomMargin (Long)– bottom margin in 100ths of a millimeter.

LeftMargin (Long) – left margin in 100ths of a millimeter.

RightMargin (Long)– right margin in 100ths of a millimeter.

TopMargin (Long)– top margin in 100ths of a millimeter.

RepeatHeadline (Boolean) – table header is repeated on every page.

Width (Long)– absolute width of the table in 100ths of a millimeter.

Rows

A table consists of a list containing rows. The following example shows how the rows of a table can be retrieved and formatted.

Dim Doc As Object Dim Table As Object Dim Cursor As Object Dim Rows As Object Dim Row As Object Dim I As Integer

Doc = StarDesktop.CurrentComponent Cursor = Doc.Text.createTextCursor()

Table = Doc.createInstance("com.sun.star.text.TextTable") Table.initialize(5, 4)

Doc.Text.insertTextContent(Cursor, Table, False) Rows = Table.getRows

For I = 0 To Rows.getCount() - 1 Row = Rows.getByIndex(I) Row.BackColor = &HFF00FF Next

The example first creates a list containing all rows using a Table.getRows call. The getCount

com.sun.star.table.XtableRows interface. The getByIndex method returns a row object, which supports the com.sun.star.text.TextTableRow service.

Here are the central methods of the com.sun.star.table.XtableRows interface:

getByIndex(Integer)– returns a row object for the specified index.

getCount()– returns the number of row objects.

insertByIndex(Index, Count) – inserts Count rows in the table as of the Index position.

removeByIndex(Index, Count)– deletes Count rows from the table as of the Index

position.

Whereas the getByIndex and getCount methods are available in all tables, the insertByIndex

and removeByIndex methods can only be used in tables that do not contain merged cells. The com.sun.star.text.TextTableRow service provides the following properties:

BackColor (Long)– background color of row.

Height (Long) – height of line in 100ths of a millimeter.

IsAutoHeight (Boolean) – table height is dynamically adapted to the content.

VertOrient (const) – vertical orientation of the text frame – details on vertical orientation of the text within the table (values in accordance with com.sun.star.text.VertOrientation)

Columns

Columns are accessed in the same way as rows, using the getByIndex, getCount,

insertByIndex and removeByIndex methods on the Column object, which is reached through

getColumns. They can, however, only be used in tables that do not contain merged table cells. Cells cannot be formatted by column in StarOffice Basic. To do so, the method of formatting individual table cells must be used.

Cells

Each cell of a StarOffice-document has a unique name. If the cursor of StarOffice is in a cell, then the name of that cell can be seen in the status bar. The top left cell is usually called A1 and the bottom right row is usually called Xn, where X stands for the letters of the top column and n for the numbers of the last row. The cell objects are available through the getCellByName() method of the table object. The following example shows a loop that passes through all the cells of a table and enters the corresponding row and column numbers into the cells.

Dim Doc As Object Dim Table As Object Dim Cursor As Object Dim Rows As Object Dim RowIndex As Integer Dim Cols As Object Dim ColIndex As Integer Dim CellName As String Dim Cell As Object

Doc = StarDesktop.CurrentComponent Cursor = Doc.Text.createTextCursor()

Table = Doc.createInstance("com.sun.star.text.TextTable") Table.initialize(5, 4)

Doc.Text.insertTextContent(Cursor, Table, False)

Rows = Table.getRows Cols = Table.getColumns

For RowIndex = 1 To Rows.getCount() For ColIndex = 1 To Cols.getCount()

CellName = Chr(64 + ColIndex) & RowIndex Cell = Table.getCellByName(CellName)

Cell.String = "row: " & CStr(RowIndex) + ", column: " & CStr(ColIndex) Next

Next

A table cell is comparable with a standard text. It supports the createTextCursor interface for creating an associated TextCursor object.

CellCursor = Cell.createTextCursor()

All formatting options for individual characters and paragraphs are therefore automatically available.

The following example searches through all tables of a text document and applies the right-align format to all cells with numerical values by means of the corresponding paragraph property.

Dim Doc As Object

Dim TextTables As Object Dim Table As Object Dim CellNames Dim Cell As Object Dim CellCursor As Object Dim I As Integer Dim J As Integer Doc = StarDesktop.CurrentComponent TextTables = Doc.getTextTables() For I = 0 to TextTables.count - 1 Table = TextTables(I) CellNames = Table.getCellNames() For J = 0 to UBound(CellNames) Cell = Table.getCellByName(CellNames(J)) If IsNumeric(Cell.String) Then CellCursor = Cell.createTextCursor() CellCursor.paraAdjust = com.sun.star.style.ParagraphAdjust.RIGHT End If Next Next

The example creates a TextTables list containing all tables of a text that are traversed in a loop. StarOffice then creates a list of the associated cell names for each of these tables. There are passed through in turn in a loop. If a cell contains a numerical value, then the example changes the

formatting correspondingly. To do this, it first creates a TextCursor object which makes reference to the content of the table cell and then adapts the paragraph properties of the table cell.