https://bugs.documentfoundation.org/show_bug.cgi?id=89783

            Bug ID: 89783
           Summary: sal_uint16 counters for containers exceed during
                    mailmerge
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 113828
  --> https://bugs.documentfoundation.org/attachment.cgi?id=113828&action=edit
main document containing 32 frames

Lot of containers for elements in writer are internally managed by
SwVectorModifyBase class which has an old method 

 102     sal_uInt16 GetPos(Value const& p) const
 103     {
 104         const_iterator const it = std::find(begin(), end(), p);
 105         return it == end() ? USHRT_MAX : it - begin();
 106     }

see http://opengrok.libreoffice.org/xref/core/sw/inc/docary.hxx#102

This means: In all concrete element container implementations/managers using
this methods, only 65536 elements can be managed in a safe way. Adding more
elements than 65536 may cause LibreOffice to do undefined things (in the
conrete scenario it freezes).

This limit can easily exceed in particular during mail merge. 

I attached some example documents that can be used as main documents for mail
merge and a datasource with >2048 datasets. They contain just 32 elements of
one type and can't be processed by mail merge with more than 2048 datasets
(32*2048 = 65336 --> 16bit limit)

In my tests the following elements were causing troubles (and maybe others,
too):
- main document with 32 sections
- main document with 32 text frames
- main document with 32 lists
- main document with 32 different header definitions (=page styles)
- main document with 32 tables

The 16bit limit needs to be eliminated. The container behind SwVectorModifyBase
is already a std::vector (which has no 16 bit limitation), but the old Method
GetPos is referred from many places of the code (>700 hits for "git grep
GetPos")

How to reproduce the issue:

1) open one of the attached 32xxx.odt files

2) use tools->mail merge wizard

3) select 2051datasets.ods as datasource (in step 3 of the wizard)

4) run step 7 of the wizard (personalize document)

--> in most cases LO freezes after 2048 datasets

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to