Kaydet (Commit) 21248f90 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

uitest: document more UNO helper methods

Change-Id: I941f5ba20a7e3176e8d9f5f64c64ada6551d533a
üst c3580d08
......@@ -8,6 +8,10 @@
# this file provides methods to interact with the new conditional format API
def get_conditional_format_from_sheet(sheet):
""" Returns a conditional format object belonging to a sheet
Keyword arguments:
sheet -- a XSheet object"""
return sheet.getPropertyValue("ConditionalFormats")
# vim: set shiftwidth=4 softtabstop=4 expandtab:
......@@ -5,10 +5,24 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
def get_sheet_from_doc(document, index):
def get_sheet_from_doc(document, index=None, name=None):
""" Returns a sheet object for a Spreadsheet document
Keyword arguments:
index -- the 0-based index of the sheet (may not be used together with name)
name -- the name of the sheet (may not be used together with index)
"""
return document.getSheets().getByIndex(index)
def get_cell_by_position(document, tab, column, row):
""" Get the cell object through its position in a document
Keyword arguments:
document -- The document that should be used
tab -- The 0-based sheet number
column -- The 0-based column number
row -- THe 0-based row number
"""
sheet = get_sheet_from_doc(document, tab)
return sheet.getCellByPosition(column, row)
......
......@@ -27,6 +27,8 @@ def mkPropertyValues(vals):
return tuple([mkPropertyValue(name, value) for (name, value) in vals.items()])
def convert_property_values_to_dict(propMap):
""" Create a dictionary from a sequence of property values
"""
ret = {}
for entry in propMap:
name = entry.Name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment