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

            Bug ID: 173426
           Summary: LibreOffice Writer's built-in "Edit Index Entry"
                    command unexpected and unwantedly activates document
                    "selection mode", which remains active after the "Edit
                    Index Entry" dialog window is closed."
           Product: LibreOffice
           Version: 26.2.5.2 release
          Hardware: x86-64 (AMD64)
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Description:
I recently discovered that LibreOffice Writer has built-in "Go to Previous
Index Entry", "Go to Next Index Entry", and "Edit Index Entry" commands. I
tried to use these commands in conjunction with each other in some "indexing
macros" I was developing with assistance from AI. (I'm not a coder. I don't
even know BASIC. But I used to write some *pretty fancy macros* for Word and
Excel back in the 90s, before Microsoft switched to Visual Basic for Whatever
and froze out all of us amateurs.)

Anyway, the "Go to Previous Index Entry" and "Go to Next Index Entry" commands
seem to work flawlessly (knock on wood), but the "Edit Index Entry" command
seems to have an unwanted side effect: when you use it to open an index entry
for editing, it activates "selection mode" in the document body itself, and
selection mode *remains* activated after you close the "Edit Index Entry"
dialog window. If you close the "Edit Index Entry" dialog window and then
navigate to another part of the document — say by using the "Go to Previous
Index Entry" or "Go to Next Index Entry" command — you end up selecting all of
the document text between the starting point and the ending point (or in our
context, between the two index marks). You can prevent this from happening by
hitting the Escape key "an extra time" after you close the "Edit Index Entry"
dialog window (whether via the X button, the Close button, or the Escape key),
and you can *escape* selection mode after the fact by hitting the Escape key.

This is slightly tedious but easy to do manually. It turns out that it's *not*
easy to do programmatically, in a macro. *I* don't know how to do it, and
Google Gemini couldn't figure out how to do it in its first two attempts. (I'm
suffering from "context-drift amnesia" burnout and packed it in after two
attempts. I will return to the AI fray when I'm ready.)

What this means is that the bug (and I'm pretty sure it *is* a bug) is making
it harder to develop macros that allow users to jump to an index entry and open
it in one concatenated "command", and then jump to the next (or previous)
entry, etc., until you find the one with the content you're looking for. It's a
bizarre little bug — I can't think of any constructive use that side effect
might have — and I think it's worth fixing.

Steps to Reproduce:
1. Create a document and insert a few/​several index entries into it.

2. Create a new custom "Indexing" menu or "Indexing" toolbar and add the "Go to
Previous Index Entry", "Go to Next Index Entry", and "Edit Index Entry"
commands to it.

3. Go to one of your index entries using the "Go to Previous Index Entry" or
"Go to Next Index Entry" command.

4. Open the index entry using the "Edit Index Entry" command, then close it.

5. Go to a different index entry (index mark) using the "Go to Previous Index
Entry" or "Go to Next Index Entry" command. LibreOffice will have selected all
of the text between the two marks (and it won't stop doing that until you
manually send an extra Escape keystroke. [Again, easy to do manually, but not
as easy to do programmatically, and kind of an amateur-hour PITA regardless!]

Actual Results:
Navigating to another location in the document after opening an index mark for
editing and then closing it selects the document test between the starting
point (the opened index entry) and the ending point.

Expected Results:
LibreOffice should not be selecting document text after an index entry is
opened for viewing/​editing unless the user deliberately activates selection
mode.


Reproducible: Always


User Profile Reset: No

Additional Info:
I can upload a public-domain book with four index-entries I added to it for the
purpose of testing — but do I really need to? The book itself is in pretty
messy condition; I converted it from EPUB3 to DOCX to ODT via Calibre, before I
learned that HTML directly into desktop LibreOffice Writer and saved as ODT is
the way to go. But if anyone wants to avoid the agony of learning how to insert
index entries, I'll do it. I realize that pretty much no one on the Document
Foundation /​ LibreOffice project side actually ever uses LibreOffice Writer's
indexing features! ;-)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to