Bug 80551

Summary: uno Sheet annotations getByIndex is based on document annotations index
Product: LibreOffice Reporter: Laurent Godard <lgodard.libre>
Component: SpreadsheetAssignee: Laurent Godard <lgodard.libre>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: markus.mohrhard
Version: 4.2.4.2 release   
Hardware: Other   
OS: All   
Whiteboard: target:4.4.0
i915 platform: i915 features:
Attachments: macro illustrating the problem - run main()

Description Laurent Godard 2014-06-26 07:56:20 UTC
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
Comment 1 Commit Notification 2014-06-27 08:10:31 UTC
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.
Comment 2 Jorendc 2014-07-01 20:32:00 UTC
Following https://gerrit.libreoffice.org/#/c/9933/ and others I mark this one as ASSIGNED.

Thanks for working on this :-).
Joren
Comment 3 Commit Notification 2014-07-02 13:03:19 UTC
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.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.