Issue 126709

Summary: OO writer hangs when client application is notified of document modification (Cannot get selection while being notified of modification)
Product: App Dev Reporter: openofficebugs
Component: apiAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P2    
Version: 4.1.2   
Target Milestone: ---   
Hardware: PC   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Test program none

Description openofficebugs 2015-11-29 07:17:08 UTC
Created attachment 85179 [details]
Test program

When a Writer document gets modified, I want to find the currently selected text to help me understand what modification has been made.  This usually occurs within a very complicated C++ extension and goes wrong, so I've isolated the code and attached it.  When translated to Java or into a macro, the equivalent code does not show the same problem.  This C++ code hangs OpenOffice 4.0.1 and 4.1.2.  Shortly after the return from modified(), control is never transferred back to run() if getSelection() has been called in the meantime.  Many other different calls are possible, including getting the text, but getting the selection with getSelection() reliably hangs the test program.
Comment 1 openofficebugs 2016-01-18 18:19:48 UTC
Does not work on Windows 7 or Windows 10, OpenOffice 4.0.1 or 4.1.1 or 4.1.2.  It is blocking my development project.
Comment 2 openofficebugs 2016-01-21 04:11:25 UTC
This is also a problem under Linux.  I happened to be testing OpenOffice 4.0.1 on Fedora, but I believe the problem to be generic.  Even LibreOffice has the problem on Windows.  On Linux I do get a message to the console of

terminate called after throwing an instance of 'com::sun::star::lang::WrappedTargetRuntimeException'

when OpenOffice [threads] seem to hang, that is, control is not returned to my test application.