Created attachment 57175 [details]
Error message in a WarningBox
Currently when something goes wrong with an extension, LibreOffice displays the error message in a WarningBox. This not very useful, because it is impossible to copy the error message from the WarningBox. User only can make a screenshot.
Error message should be either in a read-only edit control (thus copyable), or there should be a Copy to Clipboard button. For example Help - About LibreOffice uses read-only edit control.
Code pointer: SvxScriptErrorDialog in cui/source/dialogs/scriptdlg.cxx
*** Bug 43331 has been marked as a duplicate of this bug. ***
Created attachment 57774 [details]
Error dialogs created when a macro or extension fails are now contain selectable text
I created a new class in cui/. : CopyableWarningBox (copywarnbox.hxx and copywarnbox.cxx). This class gets instantiated in cui/source/dialogs/scriptdlg.cxx (last method).
I couldn't manage to do the sizing dynamically, so it creates a fix (500*300) dialog.
To test the dialog run ./soffice. Tools/Macros/Run Macro...
Expand LibreOffice Macros/Gimmicks/GetTexts and run GetCellTexts.
Created attachment 57870 [details]
Added 'Copy to Clipboard' button to error message dialogs (MessBox class)
This is another solution using a Button to copy the error message, rather than selectable MultiLineEdit control.
Created attachment 57871 [details]
Screenshot of the button
The "Copy to Clipboard" button is also showing up in other dialogs such as the one that asks if you want to save a file when closing. I don't know if this was an intended side effect or not, but I thought I should mention it in case no one noticed.
The patch got reverted due to the button intruding into ~all dialogs.
I quite liked using the MultiLineEdit instead - to make the text copy-able - was there a reason not to do that to the implementation of 'WarningBox' itself in VCL ?
If we made that selectable, I don't think we need to have the button.
MultiLineEdit is implemented in svtools, not in vcl, therefore it is not useable in low level messagebox code.
well, someone could try and move it down into vcl and solve it that way :-)
Created attachment 65167 [details]
MessBox was made copyable
Part of MultiLineEdit was moved down from stvools to vcl with name VCLMultiLineEdit. MessBox uses it to display the message in read-only mode. Some of svtools' classes - which are necessary to implement VCLMultiLineEdit - were moved to vcl as a whole.
Note: ExtTextView and ExtTextEngine classes(xtextedt.hxx) would be leaved in svtools if VCLMultiLineEdit can be defined as a template class, but two macros: IMPL_LINK end IMPL_LINK_NOARG make it impossible to use template syntax.
Created attachment 65203 [details]
Shorter and clearer form of previous attachment.
Author: Zolnai Tamás <email@example.com>
Date: Mon Aug 6 20:52:37 2012 +0200
fdo#46193 MessBox was made copyable
Part of MultiLineEdit was moved down from stvools to vcl
with name VCLMultiLineEdit. MessBox uses it to display the
message in read-only mode. Some of svtools' classes - which
are necessary to implement VCLMultiLineEdit - were moved to
vcl as a whole, and their includes are rewrite.
Note: ExtTextView and ExtTextEngine classes would be leaved in svtools
if VCLMultiLineEdit is a template class, but two macros: IMPL_LINK
end IMPL_LINK_NOARG make it impossible to use template syntax.
This seems to be an issue again.
Created attachment 117433 [details]
DB with form which produces error dialog
There is a form in the DB. When you try to open it, LO shows an error dialog box. The dialog box's content is impossible to select and copy. (Ubuntu 14.04 LO 184.108.40.206, Windows 8)
(In reply to senya from comment #12)
> This seems to be an issue again.
Please do not reopen such an old bug, it's better to make a new one.
It was a general problem that message boxes were not copyable and this was fixed, by adding the functionality to the message box class. If you find an error box somewhere in LO which does not work like that it must be an other kind of bug, I guess not the appropriate error box is used there.
Please open a new report for the bug you find. It makes easier to the developers to find a solution for that. You can add this bug report to the 'See also' field of the new report.