Bug 148979 - Field context menu should have "Update Field" item
Summary: Field context menu should have "Update Field" item
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, topicUI
Depends on:
Blocks: Fields
  Show dependency treegraph
 
Reported: 2022-05-07 20:40 UTC by Eyal Rozenberg
Modified: 2022-05-10 07:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-05-07 20:40:57 UTC
When I right-click a field in LO writer, e.g. a cross-reference, there should be a menu item on the context menu for "Update Field" (not all fields, just the right-clicked field).
Comment 1 Eyal Rozenberg 2022-05-07 20:42:18 UTC
I don't think Writer ever used to have that item, but just in case: It's missing with 

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: d9b33ed6644203141fdb0776c291425c2bc9f5ac
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Comment 2 Heiko Tietze 2022-05-09 09:24:35 UTC
Why do you expect a field not to be up-to-date?
Comment 3 Eyal Rozenberg 2022-05-09 10:09:11 UTC
(In reply to Heiko Tietze from comment #2)
> Why do you expect a field not to be up-to-date?

Because a field isn't necessarily automatically up-to-date. Or - are you saying if that happens, then it's a bug?
Comment 4 Heiko Tietze 2022-05-09 14:36:23 UTC
(In reply to Eyal Rozenberg from comment #3)
> are you saying if that happens, then it's a bug?

I don't see a reason why fields cannot show the most recent content. Miklos, what do you think?
Comment 5 Miklos Vajna 2022-05-10 07:18:42 UTC
Not updating all fields automatically has a few benefits:

1) updating all these fields can take a bit of time for large documents, so doing it on every keypress would be seen as a problem by some users (Writer could be too slow to be usable)

2) we could also have code to track the dependencies of all fields (similar to e.g. what Calc does), not having that code makes the codebase simpler

3) there is not much pressure on us to do such auto-updates in all cases, e.g. Word doesn't update fields even on file load

So given that users learned to live with not auto-updating fields, this allows a bit simpler and faster code. That being said, we do auto-update a few fields, e.g. moving a page number field to a next page auto-updates it.

On the other hand, users learned that hand-editing a generated ToC is possible, and if we take that away, they can see that as a regression.

With these in mind, completely eliminating the explicit field update doesn't sound good.

Adding a possibly to explicitly update an individual field makes sense to me.
Comment 6 Heiko Tietze 2022-05-10 07:49:51 UTC
So let's make it an interesting easyhack, guess the prototype would be ImpEditEngine::UpdateFields().