To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=61520
Issue #:|61520
Summary:|Inconsistant behaviour when setting the formula or
|value of a Cell versa a CellRange
Component:|api
Version:|680m154
Platform:|All
URL:|
OS/Version:|All
Status:|NEW
Status whiteboard:|
Keywords:|
Resolution:|
Issue type:|DEFECT
Priority:|P3
Subcomponent:|code
Assigned to:|nn
Reported by:|sw
------- Additional comments from [EMAIL PROTECTED] Thu Feb 2 03:18:49 -0800
2006 -------
When you run the macro
sub main
oRange = ThisComponent.Sheets(0).getCellRangeByName("B1")
oRange.Annotation.String = "My Comment"
oRange.Formula = "=A1"
end sub
Then the Cell "B1" will contain the formula "=A1" and have a nice Annotation
too, but when you run the macro
Sub Main
oRange = ThisComponent.Sheets(0).getCellRangeByPosition(0,0,3,3)
ThisComponent.Sheets(0).getCellRangeByName("B1").Annotation.String = "My
Comment"
ReplaceRangeFormulas(oRange, "=A1")
End Sub
with
Sub ReplaceRangeFormulas(oRange as Object, ReplaceValue)
Dim oRangeAddress as Object
Dim ColCount as Integer
Dim RowCount as Integer
Dim i as Integer
oRangeAddress = oRange.RangeAddress
ColCount = oRangeAddress.EndColumn - oRangeAddress.StartColumn
RowCount = oRangeAddress.EndRow - oRangeAddress.StartRow
Dim FillArray(RowCount) as Variant
Dim sLine(ColCount) as Variant
For i = 0 To ColCount
sLine(i) = ReplaceValue
Next i
For i = 0 To RowCount
FillArray(i) = sLine()
Next i
oRange.FormulaArray = FillArray()
End Sub
then the Cell B1 only has the changed formula without the added note.
The same holds true for "setValue" versa "setDataArray"
setFormulaArray() and setDataArray() should behave like setFormula() and
setValue() leaving the Annotation untouched.
---------------------------------------------------------------------
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]