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:
Tobias Lippert committed a patch related to this issue.
It has been pushed to "master":
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:
Affected users are encouraged to test the fix and report feedback.
Thanks for the patch, closing this as fixed.