<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - Replace SwClient with SvtListener in Writer"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=140220">140220</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Replace SwClient with SvtListener in Writer
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>Inherited From OOo
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Writer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bjoern.michaelsen@libreoffice.org
</td>
</tr></table>
<p>
<div>
<pre>Description:
SwClient is a very problematic implementation of the observer pattern(*).
However these days all SwModify's are also a sw::BroadcasterMixin. This means
the SwClient can be turned into a SvtListener without much effort to be
notified. This EasyHack is about the following:
1/ find a direct derived class of SwClient (except SwModify/ListenerEntry)
git grep public.*SwClient
2/ Instead of using SwClients Add/Remove/SWClientNotify/GetRegisteredIn, use
GetNotifier/StartListening/EndListening
an example of how this might be done can be found on gerrit:
<a href="https://gerrit.libreoffice.org/c/core/+/110495">https://gerrit.libreoffice.org/c/core/+/110495</a>
(*) more details can be found in this talk at LibOCon2018:
<a href="https://www.youtube.com/watch?v=j6Znmaroe6M">https://www.youtube.com/watch?v=j6Znmaroe6M</a>
Steps to Reproduce:
.
Actual Results:
.
Expected Results:
.
Reproducible: Always
User Profile Reset: No
Additional Info:
.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>