Bug 112256 - Insert Index makes diacritics invisible
Summary: Insert Index makes diacritics invisible
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2017-09-06 14:20 UTC by Georgy Litvinov
Modified: 2022-11-16 17:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
File to reproduce problem (9.01 KB, application/vnd.oasis.opendocument.text)
2017-09-06 14:20 UTC, Georgy Litvinov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georgy Litvinov 2017-09-06 14:20:56 UTC
Created attachment 136062 [details]
File to reproduce problem

If I try to add a word with diacritics to Index by choosing word -> Insert -> Table of Contents and Index -> Index Entry diacritic characters dissaper.
It works if I clear direct formatting after inserting diacritic character.
But this workaround not works in case I have diacritic character in font different from phrase.
As you can notice in content.xml diacritic character is still on it's place, but invisible.
Comment 1 Buovjaga 2017-09-10 17:23:41 UTC
Repro already in 3.3

Arch Linux 64-bit, KDE Plasma 5
Version: 6.0.0.0.alpha0+
Build ID: 09122a537318f7ada075820f3b1ef83a64e56751
CPU threads: 8; OS: Linux 4.12; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on September 10th 2017

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 QA Administrators 2018-09-11 02:37:27 UTC Comment hidden (obsolete)
Comment 3 Roman Kuznetsov 2018-09-11 10:00:05 UTC
still repro in 6.1.1.1 on Windows 7
Comment 4 QA Administrators 2019-09-12 02:51:16 UTC Comment hidden (obsolete)
Comment 5 Georgy Litvinov 2021-03-22 11:23:21 UTC
Bug is still present 

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 43f4769ae537310a6fe6a1edfbc6687cc26fd996
CPU threads: 8; OS: Linux 3.10; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.utf8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-03-20_00:16:48
Calc: threaded
Comment 6 Andreas Heinisch 2022-11-15 13:58:57 UTC
Problem lies in https://opengrok.libreoffice.org/xref/core/sw/source/core/txtnode/fntcache.cxx?r=6de6231f#1293 where the copy of the string "wořd".copy(0, 3) returns "wor" instead of "woř".

Atm, I don't know if the implementation of the copy function of the OUString class is wrong or something in the fntcache.
Comment 7 Andreas Heinisch 2022-11-16 17:08:30 UTC
We should check if the u_CharType here:
if (nCopyStart + nCopyLen - 1 < rInf.GetText().getLength())
{
    switch (u_charType(rInf.GetText()[nCopyStart + nCopyLen]))
    {
        case U_NON_SPACING_MARK:
        case U_ENCLOSING_MARK:
        case U_COMBINING_SPACING_MARK:
            nCopyLen += 1;
            rInf.SetIdx(TextFrameIndex(nCopyStart + 1));
            rInf.SetLen(TextFrameIndex(nCopyLen));
            break;
    }
}

But somehow the kerning array should be adjusted, and there I miss to much information of how about it works.