Bug 114416 - Property CharKeepTogether should be removed
Summary: Property CharKeepTogether should be removed
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: lowest trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro Character
  Show dependency treegraph
 
Reported: 2017-12-11 23:28 UTC by Jim Kornelsen
Modified: 2025-10-26 13:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The sheet listing the CaracterProperties marked "optional" in the .idl for the service (13.66 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-10-25 12:23 UTC, Wolfgang Jäger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Kornelsen 2017-12-11 23:28:28 UTC
Description:
A property called CharKeepTogether is described in CharacterProperties.idl but not implemented.  This can cause confusion for writing macros because it is displayed at https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1style_1_1CharacterProperties.html#a1f01c49100613675a9b896037255a2fd.

Steps to Reproduce:
Not applicable

Actual Results:  
Not applicable

Expected Results:
Not applicable


Reproducible: Always


User Profile Reset: No



Additional Info:
References that should be removed are located in:
- offapi/com/sun/star/style/CharacterProperties.idl
- offapi/type_reference/offapi.idl
- qadevOOo/objdsc - subdirectories such as sw/

This bug report is a result of the discussion at https://ask.libreoffice.org/en/question/140281/optional-character-properties/?answer=140300#post-id-140300 and https://ask.libreoffice.org/en/question/134113/how-to-detect-non-breakable-space-when-iterating-document-via-uno/.


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Comment 1 Buovjaga 2017-12-19 19:11:48 UTC
Setting to NEW per Mike K's blessing in the Ask discussions.
Comment 2 QA Administrators 2018-12-20 03:55:44 UTC Comment hidden (obsolete)
Comment 3 Wolfgang Jäger 2019-10-25 12:23:24 UTC
Created attachment 155307 [details]
The sheet listing the CaracterProperties marked "optional" in the .idl for the service

There are lots of properties marked optional in https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1style_1_1CharacterProperties.html. 
See attached sheet where they are listed as of 2019-10-25 14:00 CET. 

I only tested a small selection of them, starting with LibO V3.3.
It seems many are (were already in V 3.3) no longer optional and others are (were) no longer supported at all.

CharKeepTogether is (was) no longer supported, e.g.
CharBackColor and CharHidden (e.g.) are (were) no longer optional.

When testing I didn't find a relevant difference betwwen V 3.3 and V 6.3.3.1 insofar.
Comment 4 Wolfgang Jäger 2019-10-25 12:32:51 UTC
(In reply to Wolfgang Jäger from comment #3)
> ...
> When testing I didn't find a relevant difference betwwen V 3.3 and V 6.3.3.1
> insofar.

BTW: An accidental observation concerning the property 'CharHidden'.
V 3.3. only hid for printing while V 6.3.3.1 also hid when rendering for the display.
Comment 5 QA Administrators 2021-10-25 03:56:09 UTC Comment hidden (obsolete)
Comment 6 Jim Kornelsen 2021-10-25 14:01:50 UTC
Version: 7.2.2.2 (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

The property is still shown at https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1style_1_1CharacterProperties.html#a1f01c49100613675a9b896037255a2fd, yet it still does not exist. The following python code produces an error message <class 'AttributeError'>: CharKeepTogether:

    oParEnum = XSCRIPTCONTEXT.getDocument().getText().createEnumeration()
    while oParEnum.hasMoreElements():
        oPar = oParEnum.nextElement()
        oPortionEnum = oPar.createEnumeration()
        while oPortionEnum.hasMoreElements():
            oTextPortion = oPortionEnum.nextElement()
            if oTextPortion.TextPortionType == "Text":
                print(oTextPortion.CharKeepTogether)
Comment 7 QA Administrators 2023-10-26 03:14:52 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2025-10-26 03:14:25 UTC Comment hidden (obsolete)
Comment 9 Wolfgang Jäger 2025-10-26 13:29:20 UTC
The mentioned run-time error in user code is still thrown because the mentioned optionsl property isn't implemented.

There weren't any changes concerning the functionality requested. 

Since inside words no automatic line wrapping is applied as long as not sheet format settings (margins) force it, the property could only be relevant if a piece of text which contains whitespace must be kept together. I can't think of a real case where tabulators might be afflicted. 

So: 
The functionality of the property can (next to always - disregarding a tiny difference in width) be achieved by using U+202F in place of ordinary space. The mentioned optional property is unneeded. If an actual implementation of the property was once intended, the development of UNICODE may have made it obsolete.

If the optional property should be removed from the IDL may depend on the ODF specifications. The specialist should be asked.