Bug 159643 - Too wide error message box for long error message
Summary: Too wide error message box for long error message
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL: https://forum.languagetool.org/t/libr...
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks:
 
Reported: 2024-02-08 13:27 UTC by Ilario Gelmetti
Modified: 2024-02-27 07:15 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the error message not fitting neither in two screens (303.24 KB, image/png)
2024-02-08 13:28 UTC, Ilario Gelmetti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilario Gelmetti 2024-02-08 13:27:26 UTC
Description:
When I opened this file (a template from the Spanish government)

https://www.aei.gob.es/sites/default/files/convocatory_info/2022-12/3.Modelo_Memoria_Proyecto_PTQ.doc

with LibreOffice Writer 24.2.0.3 installed on an updated Arch Linux 64 bit and with libreoffice-extension-languagetool 6.3.1-2 installed from here:

https://aur.archlinux.org/packages/libreoffice-extension-languagetool

I got a very wide, in horizontal, error message box, which included the full error message from LanguageTool. Check out the attached screenshot taken on a two-displays setup.

I would have expected that the error message box was limited in size, and that the content was cropped or divided over more rows.

I don't think it is relevant, but here you have the full content of the terminal when I launch libreoffice and open that file:

libreoffice --safe-mode

(soffice:28203): Gdk-WARNING **: 14:23:10.876: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.
java.lang.IllegalArgumentException: 'qlt' is not a language code known to LanguageTool. Supported language codes are: ar, ast-ES, be-BY, br-FR, ca-ES, ca-ES-balear, ca-ES-valencia, da-DK, de, de-AT, de-CH, de-DE, de-DE-x-simple-language, de-DE-x-simple-language-DE, de-LU, el-GR, en, en-AU, en-CA, en-GB, en-NZ, en-US, en-ZA, eo, es, es-AR, es-ES, fa, fa-IR, fr, fr-BE, fr-CA, fr-CH, fr-FR, ga-IE, gl-ES, it, it-IT, ja-JP, km-KH, nl, nl-BE, nl-NL, pl-PL, pt, pt-AO, pt-BR, pt-MZ, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sv, sv-SE, ta-IN, tl-PH, uk-UA, zh-CN. The list of languages is read from META-INF/org/languagetool/language-module.properties in the Java classpath. See https://dev.languagetool.org/java-api for details.
	at org.languagetool.Languages.getLanguageForShortCode(Languages.java:230)
	at org.languagetool.Languages.getLanguageForShortCode(Languages.java:208)
	at org.languagetool.openoffice.MultiDocumentsHandler.getLanguage(MultiDocumentsHandler.java:791)
	at org.languagetool.openoffice.SingleDocument.getLanguage(SingleDocument.java:491)
	at org.languagetool.openoffice.LanguageToolMenus$LTHeadMenu.<init>(LanguageToolMenus.java:182)
	at org.languagetool.openoffice.LanguageToolMenus.<init>(LanguageToolMenus.java:91)
	at org.languagetool.openoffice.SingleDocument.getCheckResults(SingleDocument.java:398)
	at org.languagetool.openoffice.SingleDocument.getCheckResults(SingleDocument.java:179)
	at org.languagetool.openoffice.MultiDocumentsHandler.getCheckResults(MultiDocumentsHandler.java:262)
	at org.languagetool.openoffice.MultiDocumentsHandler.doProofreading(MultiDocumentsHandler.java:200)
	at org.languagetool.openoffice.Main.doProofreading(Main.java:80)
java.lang.IllegalArgumentException: 'qlt' is not a language code known to LanguageTool. Supported language codes are: ar, ast-ES, be-BY, br-FR, ca-ES, ca-ES-balear, ca-ES-valencia, da-DK, de, de-AT, de-CH, de-DE, de-DE-x-simple-language, de-DE-x-simple-language-DE, de-LU, el-GR, en, en-AU, en-CA, en-GB, en-NZ, en-US, en-ZA, eo, es, es-AR, es-ES, fa, fa-IR, fr, fr-BE, fr-CA, fr-CH, fr-FR, ga-IE, gl-ES, it, it-IT, ja-JP, km-KH, nl, nl-BE, nl-NL, pl-PL, pt, pt-AO, pt-BR, pt-MZ, pt-PT, ro-RO, ru-RU, sk-SK, sl-SI, sv, sv-SE, ta-IN, tl-PH, uk-UA, zh-CN. The list of languages is read from META-INF/org/languagetool/language-module.properties in the Java classpath. See https://dev.languagetool.org/java-api for details.
	at org.languagetool.Languages.getLanguageForShortCode(Languages.java:230)
	at org.languagetool.Languages.getLanguageForShortCode(Languages.java:208)
	at org.languagetool.openoffice.MultiDocumentsHandler.getLanguage(MultiDocumentsHandler.java:791)
	at org.languagetool.openoffice.SingleDocument.getLanguage(SingleDocument.java:491)
	at org.languagetool.openoffice.LanguageToolMenus$LTHeadMenu.<init>(LanguageToolMenus.java:182)
	at org.languagetool.openoffice.LanguageToolMenus.<init>(LanguageToolMenus.java:91)
	at org.languagetool.openoffice.SingleDocument.getCheckResults(SingleDocument.java:398)
	at org.languagetool.openoffice.SingleDocument.getCheckResults(SingleDocument.java:179)
	at org.languagetool.openoffice.MultiDocumentsHandler.getCheckResults(MultiDocumentsHandler.java:262)
	at org.languagetool.openoffice.MultiDocumentsHandler.doProofreading(MultiDocumentsHandler.java:200)
	at org.languagetool.openoffice.Main.doProofreading(Main.java:80)

Steps to Reproduce:
1. Install the libreoffice-extension-languagetool add-on
2. Open this file https://www.aei.gob.es/sites/default/files/convocatory_info/2022-12/3.Modelo_Memoria_Proyecto_PTQ.doc

Actual Results:
An extra wide error message is displayed, where neither the X nor the OK buttons are visible (one can move the window to the left until when they become visible, but this is unexpected and unconvenient).

Expected Results:
The error message was contained in a single screen and the OK was visible without need of moving the message box.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: 420(Build:3)
CPU threads: 4; OS: Linux 6.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
24.2.0-1
Calc: threaded
Comment 1 Ilario Gelmetti 2024-02-08 13:28:13 UTC
Created attachment 192469 [details]
Screenshot of the error message not fitting neither in two screens
Comment 2 raal 2024-02-20 22:53:07 UTC
Probably extension bug and shoul be reported to LT https://languagetooler.freshdesk.com/en/support/home ?
Comment 3 Ilario Gelmetti 2024-02-21 09:52:44 UTC
Reported also on LanguageTool forums, as suggested by email from the LanguageTool support.

https://forum.languagetool.org/t/libreoffice-extension-unrecognized-language-causes-a-too-wide-error-message-box/9819
Comment 4 Stéphane Guillou (stragu) 2024-02-27 05:05:17 UTC
Repro with LT 6.3.1 and:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d2fa44db6f8a1badece63856ee0f12db4cba9b28
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Same with gen VCL.

Hossein, what do you think? Shouldn't Java error messages be automatically wrapped (or maybe better: truncated, with option to copy text) in our dialogs?
Or is this out of our control / should be handled by extension developers?
Comment 5 Hossein 2024-02-27 07:15:39 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> Repro with LT 6.3.1 and:
> 
> Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
> Build ID: d2fa44db6f8a1badece63856ee0f12db4cba9b28
> CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
> Locale: en-AU (en_AU.UTF-8); UI: en-US
> Calc: threaded
> 
> Same with gen VCL.
> 
> Hossein, what do you think? Shouldn't Java error messages be automatically
> wrapped (or maybe better: truncated, with option to copy text) in our
> dialogs?
> Or is this out of our control / should be handled by extension developers?
@Stéphane:
I think it is a reasonable request to have the error message box fit on the screen, and be able to use buttons on the message box. The error dialog box is not usable now.

The extension developers can find ways to handle these overflow cases by making sure the lines are not too long. In this case for example, Languagetool developers can modify this part of code, as the stack trace suggests:

https://github.com/languagetool-org/languagetool/blob/38ff53e9afb8bc266cdf7651d67df0d123b3313e/languagetool-core/src/main/java/org/languagetool/Languages.java#L234

But I think the dialog itself should handle such cases, and not let it overflow the screen.

I also agree that being able to copy the message is very useful.