Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


On 14.06.2015 15:26, Matthew J. Francis wrote:
Hi,

For the past few weeks I've been working on some upgrades to PyUNO,
which have now reached (what I hope is) a sufficient level of sanity and 
stability. I've pushed the changes to:

wow, this all looks really nice!

     2. Cell ranges
     ==============

     A custom behaviour is applied to objects which implement
     com::sun::star::table::XCellRange to allow their cells and cell
     ranges to be addressed by subscript, in the style of a Python list
     or dict (read-only). This is applicable to Calc spreadsheet sheets,
     Writer text tables and cell ranges created upon these.
         cell = cellrange[0,0]       # Access cell by indices
         rng = cellrange[0,1:2]      # Access cell range by index,slice
         rng = cellrange[1:2,0]      # Access cell range by slice,index
         rng = cellrange[0:1,2:3]    # Access cell range by slices
         rng = cellrange['A1:B2']    # Access cell range by descriptor
         rng = cellrange['Name']     # Access cell range by name

     Note that the indices used are in Python/C order, and differ from
     the arguments to methods provided by XCellRange.
     - The statement cellrange[r,c], which returns the cell from row r
     and column c, is equivalent to calling
         XCellRange::getCellByPosition(c,r)
     - The statement cellrange[t:b,l:r], which returns a cell range
     covering rows t to b(non-inclusive) and columns l to r(non-
     inclusive), is equivalent to calling
         XCellRange::getCellRangeByPosition(l,t,r-1,b-1).

i'm not sure if using a different order for row and column here is a
good idea or a bad idea.  maybe some Calc developer has an opinion on it?



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.