Created attachment 101785 [details] macro illustrating the problem - run main() In a macro, get the sheet annotations the count is ok a getByIndex(0) returns the firs note of the document, not the first note of the sheet expected : the returned note should be the first of the sheet.getAnnotations() code pointers : annotations of the sheet http://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/cellsuno.cxx#6937 get By index http://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/docuno.cxx#3617 --> here index refers to notes in table ScAnnotationsObj::GetObjectByIndex_Impl http://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/docuno.cxx#3550 ScAnnotationsObj::GetAddressByIndex_Impl http://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/docuno.cxx#3541 --> here index refers to notes in doc attachement : run the Main() macro contained The 2 requested notes are not the expected one; The 0 and 1 index refer to document annotations not to sheet annotations
Markus Mohrhard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ce05c5e4b0b0b9e910b4d90013a993395dd9ed8c fix incorrect ScAnnotationsObj UNO API, fdo#80551 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Following https://gerrit.libreoffice.org/#/c/9933/ and others I mark this one as ASSIGNED. Thanks for working on this :-). Joren
Laurent Godard committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c103775cd15b658bf5db1bda081c1ba5bd653c2a correct XSheetAnnotations GetByIndex test for #fdo#80551 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.