Bug 90594

Summary: Property "Selection" provided to module com.sun.star.text.MailMerge is not evaluated correctly
Product: LibreOffice Reporter: Christoph Lutz <chrlutz>
Component: WriterAssignee: Christoph Lutz <chrlutz>
Status: RESOLVED FIXED    
Severity: normal CC: dtardon
Priority: medium    
Version: Inherited From OOo   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Christoph Lutz 2015-04-13 16:37:26 UTC
The IDL-description for the com.sun.star.text.MailMerge-Service specifies a Property "Selection" which allows to mailmerge just a subset of elements in the datasource. 

See:
http://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1text_1_1MailMerge.html#a42f93ea78e286c0f30c2ddf14e1b0cb6

The elements that need to be provided in the UNO-Sequence "Selection" are considered as "bookmarks of the ResultSet". Therefore LibreOffice transforms bookmarks into indizes in a buggy loop in http://opengrok.libreoffice.org/xref/core/sw/source/uibase/uno/unomailmerge.cxx#570. Here, the pointer pTranslated is never incremented. All translated elements from the origin Selection sequence are written to the first position of the new index list.

The bug is very old and already contained in OpenOffice 3.2.1. It seems that nobody ever really has tested this feature.