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

--- Comment #15 from Pranav Kant <[email protected]> ---
So, we looked at this in a local LibreOffice Hackathon and have found the
relevant piece of code responsible for this. The selection offsets for
consonants with a negative vowel offset are not being calculated correctly.
Just dumping the notes here, so that even if we are not able to make it by the
end of the hackathon, I or somebody else can pick it up sometime later.

I was testing this for Hindi word: प्रसारित which consists of 8 characters.

When this is selected in searchbox, the second last character is not selected.

The code is in Edit::ImplRepaint() in vcl/source/control/edit.cxx

Look for this loop:

        // selection is highlighted
        for(sal_Int32 i = 0; i < nLen; ++i)
        {
            tools::Rectangle aRect(aPos, Size(10, nTH));
            aRect.Left() = pDX[2 * i] + mnXOffset + ImplGetExtraXOffset();
            aRect.Right() = pDX[2 * i + 1] + mnXOffset + ImplGetExtraXOffset();
            SAL_DEBUG("i : " << i << ", rect: " << aRect);

The loop gives following output:

debug:2909:2909: i : 0, rect: 7x17@(2,4)
debug:2909:2909: i : 1, rect: 0x17@(9,4)
debug:2909:2909: i : 2, rect: 0x17@(9,4)
debug:2909:2909: i : 3, rect: 10x17@(9,4)
debug:2909:2909: i : 4, rect: 3x17@(19,4)
debug:2909:2909: i : 5, rect: 3x17@(22,4)
debug:2909:2909: i : 6, rect: 0x17@(25,4)
debug:2909:2909: i : 7, rect: 8x17@(32,4)


As one can see, there's a rectangle of 0x17 for i = 6. And there's a gap from
25 to 32. If we explicitly set it such that there's no gap, things work as
expected.

Surely this is not the right solution but atleast something.

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

Reply via email to