Bug 80551 - uno Sheet annotations getByIndex is based on document annotations index
Summary: uno Sheet annotations getByIndex is based on document annotations index
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.4.2 release
Hardware: Other All
: medium normal
Assignee: Laurent Godard
URL:
Whiteboard: target:4.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-26 07:56 UTC by Laurent Godard
Modified: 2014-07-03 10:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
macro illustrating the problem - run main() (19.14 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-06-26 07:56 UTC, Laurent Godard
Details

Note You need to log in before you can comment on or make changes to this bug.
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.