[Bug 75757] remove inheritance to std::map and std::vector

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Mar 19 09:36:59 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=75757

--- Comment #6 from Jan Holesovsky <kendy at collabora.com> ---
As I have just talked to other guy that was a bit confused here; let me
describe the task more thoroughly :-)

First - what is bad about inheriting from the container.  It is that that way,
you are exposing much more functionality that would be necessary in this case;
like all the container functionality that might be misused to overcome the API
that is intended here.

So for the PropertyMap, as an example:

You want to remove the inheriting from _PropertyMap, and instead provide a

_PropertyMap m_aPropMap;

private member variable.

Then change all the find(), begin(), end() etc. to m_aPropMap->find(),
m_aPropMap->begin(), m_aPropMap->end() so that the container methods are not
exposed in any way, and the GetPropertyValues() and Insert() methods are the
only way how to access the internal structure(s).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20140319/7a71acdc/attachment.html>


More information about the LibreOffice mailing list