Bug 160938 - FORMCONTROLS: Add ability to Find and Replace field names
Summary: FORMCONTROLS: Add ability to Find and Replace field names
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: All All
: low enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Form-Controls
  Show dependency treegraph
 
Reported: 2024-05-05 00:48 UTC by Steve
Modified: 2024-05-23 07:10 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example document (12.81 KB, application/vnd.oasis.opendocument.text)
2024-05-15 08:49 UTC, Heiko Tietze
Details
Example copy of table with form controls (22.28 KB, application/vnd.oasis.opendocument.text)
2024-05-23 04:36 UTC, Steve
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve 2024-05-05 00:48:38 UTC
This is a feature request to enhance the Find and Replace dialog to include the ability to find and bulk-replace form control field names.

Why would this be useful?

Many forms are repetitive. They may contain table after table of arrays of dozens of fields. At the moment, copying a table full of form controls is easy (copy/paste) however each field control must then be edited individually to ensure unique field names. This is tedious but necessary.

If a Find and Replace Field Names was available, the form designer could be much more efficient by copy/pasting the table, selecting it, and then doing a Find/Replace (with option Current selection only). For example, if a table had field names 1.1.1, 1.1.2, 1.1.3, 1.1.4, etc. then a Field Name Find/Replace of '1.1.' with '1.2.' would rename all fields at once while retaining the integrity of the naming scheme.

I realise this is a long shot request, but it would make my job easier so I thought I'd put it out there. Thanks for your consideration.
Comment 1 Eyal Rozenberg 2024-05-10 16:44:55 UTC
Support this.

UI-wise, it could be as easy as adding another checkbox in the F&R dialog: 

[ ] Field Names

like we have

[ ] Comments
Comment 2 Heiko Tietze 2024-05-14 08:20:34 UTC
Another F&R (with replace being disabled) sounds good. But isn't the sidebar enough to find a particular field name?
Comment 3 Steve 2024-05-15 05:06:03 UTC
(In reply to Heiko Tietze from comment #2)
> Another F&R (with replace being disabled) sounds good. But isn't the sidebar
> enough to find a particular field name?

Replace is a critical part of this request. Use case detailed above.
Comment 4 Heiko Tietze 2024-05-15 08:49:08 UTC
Created attachment 194124 [details]
Example document

If you copy/paste a table with form controls the resulting names are amended with a number like "top_left" becomes "top_left 1". What's wrong with it?
Comment 5 Eyal Rozenberg 2024-05-21 21:20:34 UTC
(In reply to Heiko Tietze from comment #4)
> If you copy/paste a table with form controls the resulting names are amended
> with a number like "top_left" becomes "top_left 1". What's wrong with it?

How would you know which form has top_left and which has top_left_1, just by looking at the field names?
Comment 6 Heiko Tietze 2024-05-22 07:48:06 UTC
(In reply to Eyal Rozenberg from comment #5)
> How would you know...
If you select a control the respective element is selected in the Navigator, and vice versa.

But anyway, the claim was made that...

(In reply to Steve from comment #0)
> ...copying a table full of form controls is easy (copy/paste) 
> however each field control must then be edited individually...
Which is not true.
Comment 7 Steve 2024-05-23 04:36:02 UTC
Created attachment 194288 [details]
Example copy of table with form controls
Comment 8 Steve 2024-05-23 04:49:45 UTC
(In reply to Heiko Tietze from comment #6)
> But anyway, the claim was made that...
> 
> (In reply to Steve from comment #0)
> > ...copying a table full of form controls is easy (copy/paste) 
> > however each field control must then be edited individually...
> Which is not true.

But it IS true! I create a lot of forms, and copied controls are not renamed. I just updated to LO v24.2.3.2 (on Win10 x64) to verify the behaviour has not changed.

Please see the example ODT I just uploaded. I selected the table under 1.1, CTRL-C, moved the cursor under 1.2, CTRL-V.

Note the field names in the tables are identical. The pasted fields were not renamed.

Furthermore, even if copied fields WERE renamed (e.g. your example of "top_left" becomes "top_left 1"), this still would not meet my need. I need the ability to control the field names in the copied table according to my naming convention, rather than accepting an automated decision. The reason for this is all around tab order usability as outlined in another feature request, bug 160918. It becomes even more critical when javascript authomation comes into the picture.

It should not be a surprise that disciplined authors of complex forms need a naming convention for their fields, and an easy way of adhering to it.
Comment 9 Heiko Tietze 2024-05-23 07:10:58 UTC
We discussed the topic in the design meeting.

Object names are unique and F&R is very unlikely to support some workflow. But being an ODF editor we should have a place to find all objects, and together with regular expressions it the function might become handy.