Apache OpenOffice (AOO) Bugzilla – Issue 61520
Inconsistant behaviour when setting the formula or value of a Cell versa a CellRange
Last modified: 2017-05-20 11:27:37 UTC
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.
Set ParentTaskID
changing target
set target from 2.x to 3.x according to http://wiki.services.openoffice.org/wiki/Target_3x
Reset assigne to the default "issues@openoffice.apache.org".