Bug 100033 - Frames with the same name are removed
Summary: Frames with the same name are removed
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.3.2 release
Hardware: All All
: medium normal
Assignee: Tamás Zolnai
URL:
Whiteboard: odf target:5.4.0 target:5.3.4
Keywords: bibisected, dataLoss, regression
Depends on:
Blocks:
 
Reported: 2016-05-24 18:20 UTC by Nathan Gray
Modified: 2017-10-14 21:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Contains several frames with the same name (263.09 KB, application/vnd.oasis.opendocument.text)
2016-05-24 18:20 UTC, Nathan Gray
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Gray 2016-05-24 18:20:32 UTC
Created attachment 125260 [details]
Contains several frames with the same name
Comment 1 Nathan Gray 2016-05-24 18:28:22 UTC
I have a tool that takes template odt files and does a mail merge of sorts, replacing placeholders and copying the original content as needed.  When the template contains an embedded image, this results in several frames with the same name.  Only the first 2 are shown, the rest are not shown.  

If the file is then saved, they are removed.

Attached is a simplified file, with 4 frames with the same name (draw:name="Image1").

Documents of this type previously opened in 4.4 with all frames visible.

Affects at least Linux (Ubuntu, Build ID: 1:5.1.3~rc2-0ubuntu1~trusty1), 
Windows (5.1.3) & OS X.
Comment 2 Buovjaga 2016-05-27 16:11:30 UTC
Confirmed.

I tried to bisect using bibisect repos till51 and till52, but I get a problem where only 1 tile of the LibO interface is rendered (upper left), so I can't see a bloody thing of what is going on. This occurs in the commits on the later part of till51 and older part of till52. On Ubuntu.

64-bit, KDE Plasma 5
Build ID: 5.1.3.2 Arch Linux build-1
CPU Threads: 8; OS Version: Linux 4.5; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha0+
Build ID: 60041cb237ea73c2c1885dd6afd99d88780c2dfc
CPU Threads: 8; OS Version: Linux 4.5; UI Render: default; 
Locale: fi-FI (fi_FI.UTF-8)
Built on May 26th 2016
Comment 3 Buovjaga 2016-05-27 16:26:00 UTC
Ok I could bisect by launching with SAL_USE_VCLPLUGIN=gen ./opt/program/soffice

git bisect start 'latest' 'oldest'
# good: [a8d19eafb9e195a85359dd8cdc5c46c38295caa0] 2015-08-22: source-hash-79fb61efb847405fa47235002b52ee8efad5e339
git bisect good a8d19eafb9e195a85359dd8cdc5c46c38295caa0
# good: [2ad98b12d82c4ada5756881f0d6074154976e95c] 2015-10-08: source-hash-2e6feddc53830406fa04b4a0aea49bb8438dc702
git bisect good 2ad98b12d82c4ada5756881f0d6074154976e95c
# good: [e4287d7f4aebf2543103c3dde6e1463edb50b8c2] 2015-11-01: source-hash-bf4c2f74de6b82177b5f047a96b7f8e0d54a9459
git bisect good e4287d7f4aebf2543103c3dde6e1463edb50b8c2
# good: [455dfd0b0d56d73db59d588c1cd433206f275974] 2015-11-13: source-hash-41379970e8c6b75563b7c162b4e760b9e93a5bea
git bisect good 455dfd0b0d56d73db59d588c1cd433206f275974
# good: [db3a80c5b2639cdb978d9679299e5f2833a28e59] 2015-11-19: source-hash-db5358764fdb1855ee6b401d6165ed65677bdfbe
git bisect good db3a80c5b2639cdb978d9679299e5f2833a28e59
# bad: [be5246e5bababff1cf131d06bf931afca73c23be] 2015-11-22: source-hash-966c1e94e8e2669bd623999661b95cdfefa8c6b7
git bisect bad be5246e5bababff1cf131d06bf931afca73c23be
# bad: [fb55af0347fd5ed725be31a99c45df62b596a1e9] 2015-11-21: source-hash-01de2fc790b50c04f13907026f1a7782009fea61
Comment 4 Buovjaga 2016-05-27 17:15:51 UTC
Bibisect repo used: lo-linux-dbgutil-daily-till51
nothing relevant seems to be in build-info.txt
Comment 5 Michael Stahl (allotropia) 2016-05-30 14:27:43 UTC
"draw:name" must be unique in the file, that definitely looks invalid to me.

19.197 draw:name
19.197.1 General
The draw:name attribute specifies names that are used for referencing graphical elements.


... and you can hardly reference something by a value that isn't unique.
Comment 6 Caolán McNamara 2016-06-23 14:55:45 UTC
This probably became a problem for you with...

commit de0432a9256188c7b5cd1a83858311e68c890ebf
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Wed Nov 11 13:34:43 2015 +0000

    Incredible slowness and crashes with document with vast num of frame dups
    
    it looks like draw:name values are supposed to be unique in ODF, even
    if it's not spelled out explicitly, since it exists so the frame can be
    referenced, which sort of implies that it has to be unique, so a
    document where the values aren't unique can be considered invalid
    
        19.197.10 <draw:frame>
        The draw:name attribute specifies a name by which a <draw:frame>
    element can be referenced.
    
    So reject duplicate frames
    
    Change-Id: I83f6d72fd969f667f0a8c2c85d2ffeeed672387a

I think I still hold with that argument and allowing duplicate frame names causes another (IMO) serious problem. Make your tool give the frames unique names and it should be fine then.
Comment 7 Tamás Zolnai 2017-05-17 08:45:36 UTC
Other user complained about this bug, so I'll find a way to allow frames with the same name, but still remove duplicated frames generated by LO earlier.
Comment 8 Commit Notification 2017-05-17 11:00:33 UTC
Tamás Zolnai committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6952d696439981962ad378aa28b0d16ea6e48f0e

tdf#100033: Frames with the same name are removed

It will be available in 5.4.0.

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 9 Commit Notification 2017-05-22 08:35:23 UTC
Tamás Zolnai committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e0f5f8cd19ae0b14200263cc71b2c73a28cdfa41&h=libreoffice-5-3

tdf#100033: Frames with the same name are removed

It will be available in 5.3.4.

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 10 Skrol29 2017-10-14 21:55:50 UTC
Here is my feedback: the problem is fixed in LibreOffice 5.3.4.2.

In my opinion, a « name » attribute is not quite the same purpose as an « id » attribute. Many solutions can manage multiple objects with a same name (HTML, OpenLayers, ...). And also many solutions does not hide or fail with multiple objects with same ID, they are simply not able to reach duplicates.