Bug 44812 - Sort ignores links from local url buttons to cells in the sorted range
Summary: Sort ignores links from local url buttons to cells in the sorted range
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Sorting
  Show dependency treegraph
 
Reported: 2012-01-15 11:04 UTC by andréb
Modified: 2024-10-21 02:01 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
sample of problem (15.54 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-12-05 08:07 UTC, andréb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andréb 2012-01-15 11:04:46 UTC
(Note 1 : my version of Libreoffice is in french, so the names given may not be exact translations.)
(Note 2 : would expect this bug to affect all hardware and os.)

If there is a table with links to various cells of the table from url buttons, and the table is sorted, the links are not changed to correspond to the new cell positions.

case 1) First I tried direct relative url links to specific buttons.
Inserting lines or rows properly adjusted the links.
To this point the url buttons all worked properly.
Sorting the table left the links pointing to the same position in the table, so they became corrupted.  (No longer pointing to the appropriate cells.)

case 2) Then I tried creating named ranges to the single cells in question, associating the url buttons with the named ranges.
The routine to create/modify the links insisted on creating absolute links.  However, inserting lines or rows properly adjusted the links used by the url buttons.
To this point the url buttons all worked properly.
Sorting the table left the named ranges to the same position in the table, so they became corrupted.  (No longer pointing to the appropriate cells.)

3) Note that in both cases, the url buttons still followed the links, but they pointed to the original positions, and not the new positions of the concerned cells.

4) What was expected :
The links would point to the same cells in their new positions in the table.

5) Note that if case 2 worked, it would work for any link (external or local), as the name is maintained locally.
However case 1 is easier for the user to code, since links to the local cells are made directly, without the need to create named ranges.
Comment 1 ign_christian 2013-06-22 07:24:57 UTC
Please attach sample file & explanation how to see that problem.
Then mark this bug UNCONFIRMED.
Comment 2 andréb 2013-06-22 08:15:06 UTC
(In reply to comment #1)

will do.
have to create a new sample file, since my original file from 17 months ago is no longer available.
Comment 3 Jean-Baptiste Faure 2013-12-03 05:15:19 UTC
No answer from reporter since 5 months. So closing as INVALID.

Please, feel free to reopen if you are willing to provide requested informations.

Note: the behavior of sorting may depend on the way you define your links. Generally you should use HYPERLINK() function.

Best regards. JBF
Comment 4 andréb 2013-12-05 08:07:30 UTC
Created attachment 90293 [details]
sample of problem

This shows the problem.

If the col-1 is sorted (the initial state), each button is linked to a word beginning with the first 3 letters displayed on the button.

If col-2 is sorted, each button remains linked to the same location, and does not move with the cell content.
Easily seen, as no button points to a word beginning with the first 3 letters.

If col-1 is again sorted (returning to the initial state), each button again is linked ot a word beginning with the first 3 letters, as the cells have returned to their initial position, and the links did not move with the content.

One use case for this would be a table where content is regularly added randomly, and then table is sorted.
The buttons would no longer point to the same cell content.

Note that if lines (or colomns) were inserted in the correct location, then the links would move with the insertion, and would continue to point to the correct cell content.
Comment 5 andréb 2013-12-05 08:21:57 UTC
(In reply to comment #3)
> Note: the behavior of sorting may depend on the way you define your links.
> Generally you should use HYPERLINK() function.
> 
It is defined by the formula + button definition controls, presumably using the hyperlink function behind the scenes.

Note that the "action" for defining a hyperlink is strangely called
 "open a page web" (« Ouvrir la page web »)
instead of a more appropriate
 "open a hyperlink"
or better
 "define a hyperlink"
I would be very surprised if it is not usually used for local references.

As readily seen in the definitions, all the links are defined relative to the current sheet, in the form of
 #a10
Comment 6 Algot Runeman 2014-07-27 16:41:12 UTC
Test Setup:
Kubuntu 4.13.4
LibreOffice: 4.2.4.2

The behavior on my test setup is consistent with the "bug" description.

QUESTION: Is this behavior the same in Excel?

It has been recommended to consider this as an enhancement request rather than a bug.
Comment 7 QA Administrators 2015-09-04 02:48:17 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2016-09-20 10:29:27 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2020-10-19 04:19:06 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2022-10-20 03:44:44 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2024-10-20 03:17:01 UTC Comment hidden (obsolete)
Comment 12 andréb 2024-10-21 02:01:55 UTC
Using the test file,
verifying that all buttons point to the correct item,
then reversing the sort order,
shows that the bug is still present.

With version 24.2.5.2 (x86-64) (locale fr-CA ; Mageia Linux)

(The latest version is 24.8.2 , not yet available in my stable release of Linux)