Bug 148108 - Can't change "refer using" back from Number to Chapter
Summary: Can't change "refer using" back from Number to Chapter
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2022-03-21 09:59 UTC by Eyal Rozenberg
Modified: 2023-01-18 12:18 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
A document for reproducing the bug (10.97 KB, application/vnd.oasis.opendocument.text)
2022-05-05 20:31 UTC, Eyal Rozenberg
Details
Screencast demostrating the bug (2.18 MB, video/mp4)
2022-05-05 21:07 UTC, Eyal Rozenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-03-21 09:59:50 UTC
Reproduction instructions
--------------------------


1. Create a new Writer document
2. Using the menu, at Tools | Chapter Numbering (which is misnamed by the way!) Make Heading 1 paragraphs numbered using western numerals and with a '.' separator.
3. Set the paragraph style to Heading 1; the paragraph should now be numbered.
4. Type in some text
5. Press Enter; the style should now change to Text Body
6. Insert a cross-reference to a heading - the Heading 1 you created; for "refer using", choose "Chapter". Close the dialog after inserting the cross-ref.
7. Right-click the cross-ref, choose "Edit Field..."
8. Set the "refer using" to "Number" and close the dialog.
9. Right-click the cross-ref, choose "Edit Field..."
10. Set the "refer using" to "Chapter" and close the dialog.

Expected results
------------------

After step  6, the cross-ref's displayed text is "1"
After step  8, the cross-ref's displayed text is "1."
After step 10, the cross-ref's displayed text is "1"

After step 9, the cross-ref's chosen "refer using" is "Number"

Actual results
------------------

After step  6, the cross-ref's displayed text is "1"
After step  8, the cross-ref's displayed text is "1."
After step 10, the cross-ref's displayed text remains "1"

After step 9, the cross-ref's chosen "refer using" is "Chapter".
Comment 1 Heiko Tietze 2022-03-22 07:46:04 UTC
(In reply to Eyal Rozenberg from comment #0)
> Expected results
> After step 10, the cross-ref's displayed text is "1"
> ....
> After step 10, the cross-ref's displayed text remains "1"

Don't get it.  And what exactly is the difference to bug 147774?
Comment 2 Eyal Rozenberg 2022-03-22 07:59:13 UTC
(In reply to Heiko Tietze from comment #1)
> Don't get it.

Oh, I mistyped! I meant " remains "1." ". It doesn't go back to "1".
Comment 3 Heiko Tietze 2022-03-22 08:03:30 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2022-05-02 11:50:24 UTC
Hello Eyal Rozenberg,
Please attach a screencast reproducing the issue
Comment 5 Eyal Rozenberg 2022-05-05 20:31:10 UTC
Created attachment 179948 [details]
A document for reproducing the bug

Sorry about the confusion. I'll try to make reproduction simpler. If that doesn't work I'll screencast.

So:

1. Open the attached document (148108.odt)
2. Right-click just before the cross-reference (on the single text body paragraph).
3. Choose "Edit Fields..." and note which "Refer Using" item is chosen.
4. Set the "Refer Using" choice to ""Above"/"Below""
5. Right-click just before the cross-reference
6. Choose "Edit Fields..." and note which "Refer Using" item is chosen.


Expected results:

* After step 3, "Refer Using" should show "Page Number (styled)" (as the cross-reference text is "i", which is the first page number; and the page style has page numbers use lowercase Roman numerals)
* After step 6, "Refer Using" should show ""Above"/"Below"" - which is what we had just chosen.

Actual results:

* After step 3, "Refer Using" shows "Chapter Number"
* After step 6, "Refer Using" shows "Chapter Number"

that's certainly invalid, both times, since the "Chapter Number" is "A".
Comment 6 Eyal Rozenberg 2022-05-05 21:07:21 UTC
Created attachment 179949 [details]
Screencast demostrating the bug

Here's the screencast too..
Comment 7 QA Administrators 2022-05-06 03:43:03 UTC Comment hidden (obsolete)
Comment 8 Regina Henschel 2022-05-06 08:35:02 UTC
I see the problem in a new document too. Tested with Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: e4a7a50d831cb6fca95f2afff2af5298d66b5876
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: threaded

It seems to be a problem with initializing that part of the dialog. Insert a second field. If you now use the 'next' and 'previous' buttons in the dialog, then the actual used type is selected in the 'Refer using' list.
Comment 9 Eyal Rozenberg 2022-05-06 09:04:42 UTC
(In reply to Regina Henschel from comment #8)
> I see the problem in a new document too. Tested with Version:
> It seems to be a problem with initializing that part of the dialog. Insert a
> second field. 

You mean, a second cross-reference,  yes.

> If you now use the 'next' and 'previous' buttons in the
> dialog, then the actual used type is selected in the 'Refer using' list.



Oh, wow, I didn't even realize those buttons existed! They rather easy to miss with my theme anyway, since they're gray-on-gray and it's not obvious what they even do. Maybe I should open a separate bug.


Anyway, you're right, it's the initialization. But also, when you press Ok, it doesn't change the "Refer using" choice to the mis-initialized "Chapter", it leaves the "refer using" as is (I demonstrated this in the screencast).
Comment 10 Heiko Tietze 2022-05-09 08:41:23 UTC
Miklos, Hossein: this smells like a nice easyhack. Do you have code pointers at hand?
Comment 11 Miklos Vajna 2022-05-10 07:24:20 UTC
sw/uiconfig/swriter/ui/editfielddialog.ui is the .ui file for the Edit Fields dialog, SwFieldEditDlg in sw/source/ui/fldui/fldedt.cxx is the matching class.

I'm not sure if fixing this would be an easy hack or not, perhaps Hossein has an opinion on that.
Comment 12 Hossein 2022-05-10 13:15:44 UTC
(In reply to Heiko Tietze from comment #10)
> Miklos, Hossein: this smells like a nice easyhack. Do you have code pointers
> at hand?
I'm working on this issue to estimate the amount of effort needed to fix it.