To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=56535





------- Additional comments from [EMAIL PROTECTED] Mon Dec 18 04:53:26 -0800 
2006 -------
Same with queryDependents. I was about to file an issue about queryDependents
and found this one.
The following basic-code demonstrates both.
REM run this basic code against any spreadsheet, having 2 sheets at least.
REM it creates in A2:A6 simple dependents of A1, prints the dependents' 
addresses
REM Then it moves away A2 to A1 of 2nd sheet and prints the dependetnts'
addresses again.
REM Then it prints the precedents of moved cell.
REM the moved dependent sheet(1)A2 gets lost, while the detective indicates a
dependent on another sheet.
REM the moved dependent has no precedent other than itself 
Sub Main
Dim oCellAddr as new com.sun.star.table.CellAddress
Dim oRangeAddr as new com.sun.star.table.CellRangeAddress
        oSh = ThisComponent.getSheets.getByIndex(0)
        oSh.getCellByPosition(0,1).setFormula("=$A$1")
        oSh.showDependents(oCellAddr)
        sN = oSh.getName
        
oSh.getCellRangeByPosition(0,1,0,5).fillAuto(com.sun.star.sheet.FillDirection.TO_BOTTOM,1)
        cell_A1 = thiscomponent.sheets(0).getCellByPosition(0,0)
        printDependents cell_A1, TRUE," of "& sN &".A1"
        REM Move A2 to Sheet2.A1
        oCellAddr.Sheet = 1
        oRangeAddr.StartRow = 1
        oRangeAddr.EndRow = 1
        oSh.moveRange(oCellAddr,oRangeAddr)
        printDependents cell_A1, TRUE," of "& sN &".A1 after moving A2"
        sN = ThisComponent.getSheets.getByIndex(oCellAddr.Sheet).getName
        cell_Moved =
thisComponent.getSheets.getByIndex(oCellAddr.Sheet).getCellByPosition(oCellAddr.Column,oCellAddr.Row)
        printPrecedents cell_Moved, TRUE," of "& sN &".A1"
End Sub
Sub printDependents(oCell,bRecursive As Boolean,sCaption$)
        thiscomponent.calculateAll
        sRangeNames = 
oCell.queryDependents(bRecursive).getRangeAddressesAsString
        aNames() = Split(sRangeNames,";")
        MsgBox Join(aNames(),Chr(10)),0,"DEPENDENTS"& sCaption
End Sub
Sub printPrecedents(oCell,bRecursive As Boolean,sCaption$)
        thiscomponent.calculateAll
        sRangeNames = 
oCell.queryPrecedents(bRecursive).getRangeAddressesAsString
        aNames() = Split(sRangeNames,";")
        MsgBox Join(aNames(),Chr(10)),0,"PRECEDENTS"& sCaption
End Sub

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to