On 10/18/10 07:51, Pivithuru Wijegunawardana wrote:
You can use com.sun.star.sheet.XCellRangeAddressable interface and
CellRangeAddress.

com.sun.star.sheet.XCellRangeAddressable xRangeAddr =
(com.sun.star.sheet.XCellRangeAddressable)
UnoRuntime.queryInterface(com.sun.star.sheet.XCellRangeAddressable.class,
xCellRange);

CellRangeAddress aRangeAddress = xRangeAddr.getRangeAddress();

 From aRangeAddress you can get details about range start column,start row
  and range end column,end row. Then you can get the no of columns and rows
you have in the range

int noOfColums = aRangeAddress.EndColumn - aRangeAddress.StartColumn + 1;
int noOfRows = aRangeAddress.EndRow - aRangeAddress.StartRow + 1;

Then traverse through the range using this and you can get all the cells
inside the given range.

for (int i = 0; i<  noOfColums; i++) {

             for (int j = 0; j<  noOfRows; j++) {

                     XCell cell = xCellRange.getCellByPosition(i, j);

             }

Or if the parameter has a type like "sequence< sequence< double > >" in IDL, which is "double[][]" in Java, you can just use "length" to access the array's length.

Niklas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org
For additional commands, e-mail: dev-h...@sc.openoffice.org

Reply via email to