Bug 158119

Summary: Alphabetical index: "Combine with -" only works for more than two pages
Product: LibreOffice Reporter: R. Green <greenandpleasant2000-support>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: dgp-mail
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=158127
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 89606    
Attachments: sample document

Description R. Green 2023-11-08 16:08:22 UTC
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 2; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded

Currently index page numbers do not combine if there are only two adjacent ones, but are listed separately – even if you check the "Combine with –" entry in the Edit Index dialog.

So for example, you get entries such as "117, 118" or "15, 16" rather than "117–18", or "15–16".

So could there be an additional option to allow combining of adjacent page numbers in index entries?
Comment 1 R. Green 2023-11-09 10:17:49 UTC
See also, Bug 158127.
Comment 2 Dieter 2023-11-26 12:54:29 UTC
I confirm it with

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 29d686fea9f6705b262d369fede658f824154cc0
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

It works for an index entry 3-5, but it fails for an index entry 3-4

Steps:
1. Open attached file. It has two index entries.

Actual result
First index entry shows pages 3-5, second entry pages 3;4

Expected result
Second index entry should display pages 3-4

2. Got to page 3
3. Press enter before last (yellow) paragraph, so that it moves to page 4 (and same sentence from page 4 to page 5)
4. update index

Actual and expected result
Second index entry displays 3-5
Comment 3 Dieter 2023-11-26 12:55:27 UTC
Created attachment 191042 [details]
sample document