Issue 56534

Summary: queryPrecedents (XFormulaQuery) on Calc-cells don't recognize cross-table-references
Product: App Dev Reporter: leguff <mathias>
Component: apiAssignee: stephan.wunderlich
Status: CLOSED DUPLICATE QA Contact: issues@api <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: 3.3.0 or older (OOo)   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description leguff 2005-10-24 12:11:05 UTC
try the following:
- create a new spreadsheet document and name the first table "table1"
  and the second "table"
- enter a value into table1.D24
- enter formula "=table1.D24" into table2.C6
- now get the precedents cells of table2.C6 via API and you'll find some
  unexpected values:
Sub PrintFormulaPrecedents

	spreadSheetDocument = ThisComponent
	sheet1              = spreadSheetDocument.getSheets().getByIndex(0)
	sheet2              = spreadSheetDocument.getSheets().getByIndex(1)
	
	' "table2.C2"
	formulaCell         = sheet2.getCellByPosition(2, 5)
	
	' get the precedents of this cell (Aspect: XFormulaQuery)
	ranges              = formulaCell.queryPrecedents(true)
	
	' prints: table2.C6; table2.D24 (should be table1.D24 only)
	print ranges.getRangeAddressesAsString()
	
	e = ranges.getCells().createEnumeration()
	while e.hasMoreElements()
		cell = e.nextElement()
		' prints: table2.5.2 (should be table1.23.3)
		print   "Precedents " & cell.SpreadSheet.Name _
		      & "." & cell.RangeAddress.StartRow _
		      & "." & cell.RangeAddress.StartColumn
	wend
	
End Sub
Comment 1 leguff 2005-10-24 12:21:46 UTC
Sorry, delete this issue or link to 56535.
Firefox tricked me :-(((
Comment 2 stephan.wunderlich 2005-10-31 17:09:31 UTC
setting to duplicate

*** This issue has been marked as a duplicate of 56535 ***
Comment 3 stephan.wunderlich 2005-10-31 17:10:19 UTC
closing as duplicate