Bug 152741 - Single line plain text content control: LO doesn't prevent CR in multiline=false controls
Summary: Single line plain text content control: LO doesn't prevent CR in multiline=fa...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: runSDT, missing implementation
Keywords:
: 154305 (view as bug list)
Depends on:
Blocks: DOCX-Content_Control
  Show dependency treegraph
 
Reported: 2022-12-30 20:34 UTC by Luge
Modified: 2024-11-25 21:23 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Word 2016 (17.60 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2023-08-01 19:14 UTC, Gabor Kelemen (allotropia)
Details
The first control with disabled linebreaks option (85.02 KB, image/png)
2023-08-01 19:16 UTC, Gabor Kelemen (allotropia)
Details
The second control with enabled linebreaks option (81.44 KB, image/png)
2023-08-01 19:16 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luge 2022-12-30 20:34:31 UTC
Description:
I created a form with MS Word. I added single line plain text content controls (text box). When the form is opened with Libre Office, it does not recognize that these text boxes should be single line and allows multiple lines. Libre Office does not trap the carriage returns. 

Steps to Reproduce:
1. Use MS Word to create a form with single line plain text content controls
2. Make sure they are single line. Save document.
3. Open document with LibreOffice
4. Type text in the single line controls. Press ENTER to type a second line.
5. Should not be able to add a second line since it was created as single line.
6. LibreOffice does not trap carriage returns.

Actual Results:
Multiple lines can be created in a single line text control.

Expected Results:
Single line only


Reproducible: Always


User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: StartModule
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: yes
Comment 1 Buovjaga 2023-03-17 12:22:09 UTC Comment hidden (obsolete)
Comment 2 Gabor Kelemen (allotropia) 2023-08-01 19:14:51 UTC
Created attachment 188705 [details]
Example file from Word 2016

Example file with two plain text control. This bug is about the "Allow carriage returns (multiple paragraphs)" property in the Plain text content controls settings dialog.

First has the default value, disabled. In Word, you cannot press Enter inside this and type text into a new line.
Second has it enabled, you can press Enter inside this and start typing into a new line.

Writer does not have this property in the content controls settings dialog, so both controls allow using the line breaks.
Comment 3 Gabor Kelemen (allotropia) 2023-08-01 19:16:08 UTC
Created attachment 188706 [details]
The first control with disabled linebreaks option
Comment 4 Gabor Kelemen (allotropia) 2023-08-01 19:16:47 UTC
Created attachment 188707 [details]
The second control with enabled linebreaks option
Comment 5 Justin L 2023-08-22 00:34:10 UTC
while bug 81507 has ensured that multiline is not lost, there is no code that implements allowing/preventing multiline in LO, nor is it yet a content control property in sw/inc/formatcontentcontrol.hxx.

multiLine (Allow Soft Line Breaks)
Specifies whether soft line breaks can be added to the contents of this structured document tag when this document is modified. This setting shall not affect the ability of the structured document tag to display existing soft line breaks (which shall be preserved) and shall only affect the ability to add line breaks when the document is modified by an application.

If this attribute is omitted, then the parent plain text structured document control shall not allow soft line breaks to be added to its contents.
Comment 6 Justin L 2024-07-24 13:01:20 UTC
(In reply to Justin L from comment #5)
> nor is it yet a content control property in sw/inc/formatcontentcontrol.hxx.
It should be there as of LO 24.2, commit 5082d50d24c3fec4487c724a15eb0d54a82ecd0d
Comment 7 Buovjaga 2024-10-30 12:26:48 UTC
*** Bug 154305 has been marked as a duplicate of this bug. ***