Bug 143175 - Duplicated keywords in document properties form if save in DOCX format
Summary: Duplicated keywords in document properties form if save in DOCX format
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.beta1+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-03 11:18 UTC by Alex Chernous
Modified: 2021-07-04 10:30 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Chernous 2021-07-03 11:18:27 UTC
Description:
Description:
If I add any keywords in 'description' tab on file property dialog and save document in MS Office 2007-365 format (docx, xlsx etc.) then it duplicate first keyword and continue duplicate every time if open property dialog and then save.

Steps to Reproduce:
1. Create new document
2. Open File Property dialog 'description' tab
3. Add one ore more keywords
4. Save document in MS Office 2007-365 format
5. Close and reopen document and File Property dialog 'description' tab

Actual Results:
Show duplicate first keyword

Expected Results:
Show the keywords as they were written


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.2.0.0.beta1+ / LibreOffice Community
Build ID: fe4e891a0ab34aabe3e1cdc425502feba6dffdd8
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ru-RU (ru_RU.UTF-8); UI: ru-RU
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:libreoffice-7-2, Time: 2021-07-01_23:03:20
Calc: threaded
Comment 1 Andreas Heinisch 2021-07-03 11:45:52 UTC
Confirmed in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 0aea0cee58fe77a9058217dfdfc3d6a02b29ee2a
CPU threads: 6; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: CL
Comment 2 Andreas Heinisch 2021-07-03 15:27:00 UTC
Regression introduced by:

use for-range on Sequence in i18npool..sd
Change-Id: I19eba57bc6058c317473d0746f06699a09ba2830
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94608
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>

in https://opengrok.libreoffice.org/xref/core/oox/source/core/xmlfilterbase.cxx?r=d50501d1#603

Previous line was:

for( sal_Int32 i = 1, end = aItems.getLength(); i < end; ++i )

changed to

for( const OUString& rItem : aItems )

which includes also the first item, hence duplicating it.

Noel should I resolve the problem including an automated test, or do you want to fix it?
Comment 3 Noel Grandin 2021-07-03 15:44:16 UTC
@Andreas, you are welcome to fix it if you want to :-)
Comment 4 Commit Notification 2021-07-04 07:11:12 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/965639aec1407c25bed1716a1f2c3ee19923ec1a

tdf#143175 - Join elements including a delimiter using a standard iterator

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.