Bug 143368 - UI: Setting language for paragraph points to dialog label 'Character'
Summary: UI: Setting language for paragraph points to dialog label 'Character'
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:7.6.0
Keywords: bibisected, bisected, needsUXEval, regression
Depends on:
Blocks:
 
Reported: 2021-07-14 17:56 UTC by Telesto
Modified: 2023-07-27 18:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (8.16 KB, application/vnd.oasis.opendocument.text)
2021-07-14 17:56 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-07-14 17:56:19 UTC
Description:
Setting language for paragraph points to dialog label 'Character' 

Steps to Reproduce:
1. Open the attached file
2. Right Click Hello
3. the context menu contains -> Set language for paragraph
4. Expand -> Click More

Actual Results:
Character dialog opens

Expected Results:
Well I was in search where I could find Paragraph Style Direct Format in a dialog.
If you change the language in the status bar to something different from default, you get Paragraph Style Direct Format. However kind of surprised by the existence of Paragraph Style Direct Format as such (an surely no clue where that can be managed)

Clear Direct Formatting doesn't remove.. that's for sure. And if you change the default document language.. and set it back to default.. this already persistent change (as it's written as DF indefinitely)


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4e0a7df2dfa10bc52d5dbda34f43e0bc0df22ae7
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-07-14 17:56:34 UTC
Created attachment 173582 [details]
Example file
Comment 2 Heiko Tietze 2021-07-20 10:52:46 UTC
True, "More..." applies the language on the selection for both the top level and the sub menu "Set Language for Paragraph". We could just hide it there since language cannot be set as P-DF. Which would be an option too, of course, to add the Font tab. 

Mike, what do you think?
Comment 3 Mike Kaganski 2021-07-20 11:11:30 UTC
(In reply to Heiko Tietze from comment #2)
> language cannot be set as P-DF

Wrong, it can be (and is) set as paragraph direct formatting.
Comment 4 Heiko Tietze 2021-07-20 13:20:08 UTC
(In reply to Mike Kaganski from comment #3)
> Wrong, it can be (and is) set as paragraph direct formatting.

True, if the whole paragraph is selected both options change the D-PS. What I meant is "cannot be set via dialog".
Comment 5 Mike Kaganski 2021-07-20 13:38:46 UTC
(In reply to Heiko Tietze from comment #4)
> What I meant is "cannot be set via dialog".

No, what you see is just a regression. The dialog should set *paragraph* DF when called for paragraph (irrespective of its caption).

Compare v.5.0 and v.7.2+:

1. Open attachment 173582 [details]
2. Put text cursor to "Hello"
3. Menu Tools->Language->For Paragraph->More
4. Set Western Text Font's Language to some value and close the dialog
5. Put text cursor to the end of the paragraph (after the space after the "Hello") and check the language in the status bar
6. Save (as) and close
7. Open in 7.2+ to inspect in Style Inspector

The differences are:
* In 5.0, step 5 shows the language set at step 4; step 7 shows that only Paragraph DF contains Char Locale property in the Hello paragraph.
* In 7.2+, step 5 gives "Italian (Italy)" which was there initially (so only language of the word was defined in step 4); step 7 shows that both Paragraph DF and Character DF are set when you are inside the "Hello" word.

So this is just a regression needing a separate issue, bibisection, and fixing. If this question is only caused by the regression, then it could be converted to such; otherwise, the question should be clarified with the updated information in mind.
Comment 6 Mike Kaganski 2021-07-20 13:44:02 UTC
See also bug 103036 comment 7.
Comment 7 Buovjaga 2021-08-26 12:11:46 UTC
Already in oldest of 6.3 repo, someone else can continue narrowing it down
Comment 8 Justin L 2021-11-27 09:58:08 UTC
I didn't go into the detail mentioned in comment 5, but just checked whether it was the "Character" dialog that is used for paragraph properties. That was already true as far back as I can check in LO 3.5.

svx/sdi/svx.sdi:SfxVoidItem FontDialogForParagraph SID_CHAR_DLG_FOR_PARAGRAPH

The way this is used is that the entire paragraph is selected, and then the character dialog is applied to the whole selection.

It is probably not terribly hard, but it is non-trivial to change this. So I won't.
Comment 9 Justin L 2023-05-11 01:13:27 UTC
broken in LO 6.1 with commit ce9594d40a8d72370624b045761df4e0078d601e
Author: Jan Holesovsky on Tue Jan 16 13:41:34 2018 +0100
    lokdialog: Convert the Format -> Character... dialog to async exec.
Comment 10 Justin L 2023-05-11 01:27:01 UTC
CC: Kendy

Browsing the code change, there is nothing that suggests what could be the cause. The result can easily be seen even in the older version. Before the change, going to the space after hello shows the new paragraph language - since it affected the whole paragraph. After the change, only the word itself is changed, and not the space character at the end.
Comment 11 Justin L 2023-05-11 01:59:46 UTC
The problem is that the artificial selection is lost.
It is looking for rWrtSh.IsSelFullPara(), but it is getting an empty rWrtSh.GetSelText()
Comment 12 Justin L 2023-05-11 15:17:06 UTC
proposed fix at https://gerrit.libreoffice.org/c/core/+/151678
Comment 13 Commit Notification 2023-05-11 16:39:32 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3230d0e2a8b66634c7399764a9625b0b8e9bb307

tdf#143368 sw CHAR_DLG_FOR_PARAGRAPH: restore selection

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Heiko Tietze 2023-07-24 11:28:02 UTC
Justin, is this fixed?
Comment 15 Justin L 2023-07-27 18:07:53 UTC
(In reply to Mike Kaganski from comment #5)
> So this is just a regression needing a separate issue, bibisection, and
> fixing.
Based on this, and the fixed regression, I should have marked this as fixed earlier.