diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2021-01-23 01:09:49 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2021-01-29 23:10:59 +0100 |
commit | d77552970af7ffb9d06bcd57315979f317e94e2f (patch) | |
tree | 9ba78f893f57efc2ab0f8d542abb70032c240ee3 /sw/inc/format.hxx | |
parent | c6ff20f1c101372be46a2583ec0c83ff021690a9 (diff) |
remove SwCache bookkeeping from SwModify
- only very few classes (SwNode, SwFormat) are the "owners"
of SwBorderAttrs in the SwCache
- this bookkeeping should not be in such a fundamental class of writer
- also: encapsulate most of the interaction with the cache in the new
sw::BorderCacheOwner. This is mostly to protect the innocent user:
* As interacting with the SwCache directly is very errorprone, because
its glorious idea of using void* of the "owners" as keys to the
entries.
* In C++, reinterpret_cast<void*>(this) might be different along the
class heirachy. This might easily slip under the radar of a casual
user.
Change-Id: I0da774b47885abf52f63aab8d93ebbf41dcf8040
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110112
Tested-by: Jenkins
Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/inc/format.hxx')
-rw-r--r-- | sw/inc/format.hxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index f1e301ba50d0..29c3fab36033 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -20,9 +20,11 @@ #define INCLUDED_SW_INC_FORMAT_HXX #include "swdllapi.h" -#include "swatrset.hxx" + +#include "BorderCacheOwner.hxx" #include "calbck.hxx" #include "hintids.hxx" +#include "swatrset.hxx" #include <memory> class IDocumentSettingAccess; @@ -41,7 +43,7 @@ namespace drawinglayer::attribute { } /// Base class for various Writer styles. -class SW_DLLPUBLIC SwFormat : public sw::BroadcastingModify +class SW_DLLPUBLIC SwFormat : public sw::BorderCacheOwner, public sw::BroadcastingModify { friend class SwFrameFormat; |