Bug 118777 - [Crash] Insert Signature Line after select image object
Summary: [Crash] Insert Signature Line after select image object
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All All
: highest critical
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0 target:6.1.1 target:6.1.0
Keywords: bibisected, bisected, regression
: 119006 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-16 03:19 UTC by sawakaze
Modified: 2018-07-30 21:22 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
screen capture (132.67 KB, application/vnd.oasis.opendocument.graphics)
2018-07-16 03:20 UTC, sawakaze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sawakaze 2018-07-16 03:19:48 UTC
Description:
On Writer, when select image object and insert Signature Line, LibreOffice Crashed.
Detail is "Step to Reproduce" and attachment file.

Crash Report is 
http://crashreport.libreoffice.org/stats/crash_details/2e1302af-065a-489f-98c6-1799d098a18d


Steps to Reproduce:
1. Open .odt file including image. 
2. Select image object.
3. Insert > Signature Line...
 -> Open Signature Line window
4. Press OK
--> application crash

Actual Results:
application crash

Expected Results:
not crash.
I think, when user select image object, user cannot select Signature Line. 


Reproducible: Always


User Profile Reset: No



Additional Info:
testing env

OS: Linux x64 (Ubuntu MATE)

Version: 6.1.0.1.0+
Build ID: e315d631c08454d8688d15cd52ce8e3839972530
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:libreoffice-6-1, Time: 2018-07-15_04:53:29
Locale: en-US (C); Calc: group threaded
Comment 1 sawakaze 2018-07-16 03:20:27 UTC
Created attachment 143566 [details]
screen capture
Comment 2 Dieter 2018-07-16 07:03:53 UTC
I tried to reproduce it with an image and with an object (like in the attachment), but I couldn't reproduce it.

Version: 6.2.0.0.alpha0+ (x64)
Build ID: b0e291a7efcd3af2a72d0b622b1f1b84723f011f
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-30_23:43:40
Locale: en-US (de_DE); Calc: CL
Comment 3 Xisco Faulí 2018-07-16 15:01:22 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=8905ae9f0fc8b0e4a95113fd81e88d4e7db57bcc

author	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2018-07-05 21:48:49 +0200
committer	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2018-07-06 07:44:16 +0200
commit 8905ae9f0fc8b0e4a95113fd81e88d4e7db57bcc (patch)
tree 99b2561abcb835e0851b7063dee9d0a3338b996c
parent 3aa4edb1028bfafff38efda8843f8ebe43a38155 (diff)
Writer: Insert signature line at current cursor position

Bisected with: bibisect-linux64-6.2

Adding Cc: to Samuel Mehrbrodt
Comment 4 Xisco Faulí 2018-07-16 15:02:40 UTC
Increasing severity as the patch has been cherry-picked to 6.1 -> https://gerrit.libreoffice.org/#/c/57035/4
Comment 5 Julien Nabet 2018-07-23 16:35:46 UTC
On pc Debian x86-64 with master sources updated 2 days ago, I could reproduce this.

I noticed this log:
warn:vcl:22563:22563:vcl/source/app/salusereventlist.cxx:114: Uncaught com.sun.star.uno.RuntimeException text interface and cursor not related
Comment 6 Xisco Faulí 2018-07-23 19:24:47 UTC
In

Versión: 6.1.0.2
Id. de compilación: b3972dcf1284967612d5ee04fea9d15bcf0cc106
Subprocs. CPU: 1; SO: Windows 6.1; Repres. IU: predet.; 
Configuración regional: es-ES (es_ES); Calc: group threaded


I get the error: 'text interface and cursor not related'
Comment 7 Julien Nabet 2018-07-23 19:41:38 UTC
(In reply to Xisco Faulí from comment #6)
> ...
> I get the error: 'text interface and cursor not related'

The only location where this message is put is here:
https://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unotext.cxx#573
Comment 8 Thorsten Behrens (allotropia) 2018-07-23 23:00:50 UTC
Bubli, Michael - any quick remedy?
Comment 9 Katarina Behrens (Inactive) 2018-07-24 08:59:26 UTC
(In reply to Thorsten Behrens (CIB) from comment #8)
> Bubli, Michael - any quick remedy?

Nay, no immediate idea. It happens every time a non-text object is selected and I know very little of Writer UNO API to say why is this happening. In unotext.cxx:

if (pOwnStartNode != pTmp)
{
    uno::RuntimeException aRunException;
    aRunException.Message = "text interface and cursor not related";
    throw aRunException;
}

What is expected to happen in such case anyway, should the signature line be inserted after the selected object, or should it replace the object?
Comment 10 Michael Stahl (allotropia) 2018-07-24 10:51:08 UTC
this is all a bit inconsistent and non-obivous:

if an image or shape is selected, then the view cursor doesn't have a valid model position, and most of the Insert menu entries are disabled.

except for:

- Insert Image ... which replaces the existing image (if image selected), or applies the image as background to existing shape

- Insert Shape ... which requires mouse interaction and will anchor the shape close to the drawn rectangle, via GetCrsrOfst

- Insert Fontwork ... which anchors the shape close to the center of the docuemnt view, via GetCrsrOfst

The SwXViewCursor has a method to get the view position as x/y coordinates via:

offapi/com/sun/star/text/XTextViewCursor.idl:    com::sun::star::awt::Point getPosition();

... but there appears to be no way to convert that to a model (text cursor) position via the API, which is surprising, i.e. there is no API equivalent to GetCursorOfst.

the Signature Line dialog is implemented in cui and uses the API, hence i don't see any way to fix this except for simply disabling the menu item when image shape is selected, similar to the other disabled items.
Comment 11 Xisco Faulí 2018-07-24 11:03:19 UTC
> the Signature Line dialog is implemented in cui and uses the API, hence i
> don't see any way to fix this except for simply disabling the menu item when
> image shape is selected, similar to the other disabled items.

it sounds like a good solution to me...
Comment 12 Commit Notification 2018-07-25 12:41:13 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7213a583f5c1d42c05dc4f19b4d4d2f9dded7733

tdf#118777 cui: use right XText in SignatureLineDialog

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2018-07-25 15:36:05 UTC
Katarina Behrens committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2a00e1f98d4cca448c1394e2504cc7539cb9ac1d

tdf#118777: Disable signature line slot if non-text object

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2018-07-25 18:42:52 UTC
Katarina Behrens committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=545ddabc6614e751c807e9d1e1cbf7c617fc4141&h=libreoffice-6-1

tdf#118777: Disable signature line slot if non-text object

It will be available in 6.1.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2018-07-25 20:04:19 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8a4f07b367284e898898b1840fc22f357099aba9&h=libreoffice-6-1

tdf#118777 cui: use right XText in SignatureLineDialog

It will be available in 6.1.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 16 Michael Stahl (allotropia) 2018-07-26 08:41:45 UTC
should be fixed now
Comment 17 Xisco Faulí 2018-07-26 08:45:51 UTC
(In reply to Michael Stahl from comment #16)
> should be fixed now

Thanks!
should it be cherry-picked to libreoffice-6-1-0 ?
Comment 18 Commit Notification 2018-07-27 06:23:37 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=63543c44f2ce1af3b8a1cb350f9d03bc75a54f7d&h=libreoffice-6-1-0

tdf#118777 cui: use right XText in SignatureLineDialog

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 19 Commit Notification 2018-07-27 06:25:02 UTC
Katarina Behrens committed a patch related to this issue.
It has been pushed to "libreoffice-6-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e01c0d3d64331cfc91e3d7c2cff69e44bade4e32&h=libreoffice-6-1-0

tdf#118777: Disable signature line slot if non-text object

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 20 Xisco Faulí 2018-07-27 10:31:04 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: aa84f1458f422c1acf38b53a3e3138cd0e84e313
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

The option is disabled now.

@bubli, @mst, Thanks for fixing this!!
Comment 21 Xisco Faulí 2018-07-30 21:22:02 UTC
*** Bug 119006 has been marked as a duplicate of this bug. ***