Bug 89674 - Allow use of fields in numbered headings
Summary: Allow use of fields in numbered headings
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Fields
  Show dependency treegraph
 
Reported: 2015-02-26 07:51 UTC by Ulrich Windl
Modified: 2019-01-24 09:36 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot with existing opportunity (31.38 KB, image/png)
2019-01-16 14:49 UTC, Roman Kuznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Windl 2015-02-26 07:51:07 UTC
In Writer you can use custom prefixes and suffixes for automatically generated numbered headings, but you cannot use the value of a field (variable).
Using a field (variable) value for numbered headings seems useful.
Example: You are writing a summary for a periodic conference, and you want all headings be numbered with the number of the conference first (like 101.1, 101.2, ...). If you arew creating a document template, allowing use of a variable like "conference number = 101" seems very useful to me.
Comment 1 Buovjaga 2015-03-03 16:37:31 UTC
Sounds useful -> NEW.
Comment 2 Roman Kuznetsov 2019-01-16 14:48:45 UTC Comment hidden (obsolete)
Comment 3 Roman Kuznetsov 2019-01-16 14:49:27 UTC
Created attachment 148358 [details]
Screenshot with existing opportunity
Comment 4 Buovjaga 2019-01-16 15:28:09 UTC
(In reply to Roman Kuznetsov from comment #2)
> I can create this chapter numbering style uses existing opportunity in
> dialogue Chapter Numbering in LO 6.3
> 
> may be close it as WFM?

Ulrich wants to use the field in a document template. He would probably use it for other things in addition to the numbering prefix.

Ulrich: do you want to describe the benefits of this feature in more detail?
Comment 5 Ulrich Windl 2019-01-21 08:05:19 UTC
(In reply to Roman Kuznetsov from comment #2)
> I can create this chapter numbering style uses existing opportunity in
> dialogue Chapter Numbering in LO 6.3

It had always been possible to add a constant numbering prefix, but it is not possible to use a field value for it.

(In reply to Buovjaga from comment #4)
> Ulrich: do you want to describe the benefits of this feature in more detail?

My idea was to use the feature in a document template, where the user would fill in some properties, and then parts of those properties can be used in the actual numbering.  I mean: If nroff could do it 30 years ago, do we need to be behind so far? ;-)
Comment 6 Buovjaga 2019-01-21 08:31:06 UTC
I will summon our UX visionaries.
Comment 7 Heiko Tietze 2019-01-21 11:16:16 UTC
If we do that users likely request the field option to be present in the numbering dialog. And that makes a quite complex dialog even worse. Would keep this in mind anyway.
Comment 8 Buovjaga 2019-01-21 11:28:45 UTC
I wonder, if this could be solved with macro scripting, though? It is a rather niche feature to be included in core (now that I reconsider my 2015 opinion).
Comment 9 Ulrich Windl 2019-01-21 11:45:31 UTC
(In reply to Heiko Tietze from comment #7)
> If we do that users likely request the field option to be present in the
> numbering dialog. And that makes a quite complex dialog even worse. Would
> keep this in mind anyway.

I see several components for this enhancement:

1) Be able to express the feature in the ODT format

2) Be able to create (and use) the feature with writer somehow (the numbering dialog looks like a good candidate actually)

3) Be able to enter a field name where literal input is required (either allow some meta syntax like "$var" to mean "insert the value of variable `var' (at runtime), or present a pull-down list of available variables). Depends on the level of users who may want to use that...
Comment 10 Cor Nouws 2019-01-22 20:34:47 UTC
(In reply to Heiko Tietze from comment #7)
> If we do that users likely request the field option to be present in the
> numbering dialog. And that makes a quite complex dialog even worse. 
Not sure about that.
Ctrl+F2 for the fields
and File > Properties .. for custom doc props.
Comment 11 Heiko Tietze 2019-01-24 09:36:19 UTC
To summarize, the field would be nice. It add's another dropdown which contains field types plus "Static Text" (default, current behavior). Depending on the selection we have to change the input field from a edit control to whatever the field type contains and fill it with the respective data.

However, the more simple and easy solution would be an extension. It could iterate over the headings and insert content before.