The code in SdrTextObj::ImpSetTextStyleSheetListeners is obviously not working correctly. The families of the stylesheets are appended to the name of the family for further usage. An encoded string looks like "STYLE_NAME|3 " The family is then extracted by copying the first (length-6) bytes, e.g., "STYLE_NAME" in this example. Then another copy starting a position 1 is created, e.g., "TYLE_NAME". This string is cast to an Int32. Since this is not possible, 0 is returned, and the originally stored family is lost.
The proposed patch can be found here: https://gerrit.libreoffice.org/#/c/10818/
Tobias Lippert committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5013ac55090ab7a64b9549df67196aa5c7479542 fdo#84061 Fix setting text style sheet listeners in SdrTextObj 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.
Thanks for the patch, closing this as fixed.