Visitar URL original
Revert "stronger typing for SwClient::GetRegisteredIn" · bise86/LibreOffice@b5f3756 · GitHub
Skip to content

Commit b5f3756

Browse files
committed
Revert "stronger typing for SwClient::GetRegisteredIn"
This reverts commit 687080c, as it caused e.g. CppunitTest_sw_docbookexport to fail with > sw/inc/calbck.hxx:428:18: runtime error: downcast of address 0x7ba8053a9db8 which does not point to an object of type 'SwClient' (aka 'ClientBase<SwModify>') > 0x7ba8053a9da0: note: object is base class subobject at offset 24 within object of type 'SwFormatHeader' > 00 00 00 00 d0 8b c9 ae 47 7b 00 00 01 00 00 00 66 00 48 01 40 6c 00 00 88 be be be 50 8c c9 ae > ^ ~~~~~~~~~~~ > vptr for 'sw::ClientBase<SwFrameFormat>' base class of 'SwFormatHeader' > #0 in SwIterator<sw::ClientBase<SwModify>, SwModify, (sw::IteratorMode)0>::First() at sw/inc/calbck.hxx:428:18 > LibreOffice#1 in SwModify::CallSwClientNotify(SfxHint const&) const at sw/source/core/attr/calbck.cxx:237:35 > LibreOffice#2 in sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const at sw/source/core/attr/calbck.cxx:259:15 > LibreOffice#3 in SwModify::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/attr/calbck.cxx:229:5 > LibreOffice#4 in SwFormat::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/attr/format.cxx:309:19 > LibreOffice#5 in SwFrameFormat::SwClientNotify(SwModify const&, SfxHint const&) at sw/source/core/layout/atrfrm.cxx:2849:15 > LibreOffice#6 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet const&, SwAttrSet&, SwAttrSet&) at sw/source/core/attr/calbck.cxx:268:13 > LibreOffice#7 in SwFormat::SetFormatAttr(SfxItemSet const&) at sw/source/core/attr/format.cxx:604:13 > LibreOffice#8 in FillHdFt(SwFrameFormat*, SfxItemSet const&) at sw/source/uibase/utlui/uitool.cxx:239:14 > LibreOffice#9 in ItemSetToPageDesc(SfxItemSet const&, SwPageDesc&) at sw/source/uibase/utlui/uitool.cxx:340:13 > LibreOffice#10 in SwDocStyleSheet::SetItemSet(SfxItemSet const&, bool, bool) at sw/source/uibase/app/docstyle.cxx:1894:13 > LibreOffice#11 in SwXPageStyle::SetPropertyValues_Impl(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) at sw/source/core/unocore/unostyle.cxx:3157:33 > LibreOffice#12 in SwXPageStyle::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) at sw/source/core/unocore/unostyle.cxx:3453:5 > LibreOffice#13 in writerfilter::dmapper::DomainMapper_Impl::PushPageHeaderFooter(writerfilter::dmapper::PagePartType, writerfilter::dmapper::PageType) at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:3910:25 > LibreOffice#14 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx:10049:13 > LibreOffice#15 in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/DomainMapper.cxx:4746:14 > LibreOffice#16 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at sw/source/writerfilter/dmapper/LoggedResources.cxx:272:5 > LibreOffice#17 in writerfilter::ooxml::OOXMLDocumentImpl::resolveFastSubStreamWithId(writerfilter::Stream&, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&, unsigned int) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:127:13 > LibreOffice#18 in writerfilter::ooxml::OOXMLDocumentImpl::resolveHeader(writerfilter::Stream&, int, rtl::OUString const&) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:384:10 > LibreOffice#19 in writerfilter::ooxml::OOXMLFastContextHandler::resolveHeader(int, rtl::OUString const&) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:895:35 > LibreOffice#20 in writerfilter::ooxml::OOXMLHeaderHandler::finalize() at sw/source/writerfilter/ooxml/Handler.cxx:214:20 > LibreOffice#21 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::handleHdrFtr() at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:1117:28 > LibreOffice#22 in writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at workdir/CustomTarget/sw/source/writerfilter/ooxml/OOXMLFactory_wml.cxx:7530:26 > LibreOffice#23 in writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at sw/source/writerfilter/ooxml/OOXMLFactory.cxx:157:19 > LibreOffice#24 in writerfilter::ooxml::OOXMLFastContextHandler::endAction() at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:320:5 > LibreOffice#25 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::lcl_endFastElement(int) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:1038:9 > LibreOffice#26 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at sw/source/writerfilter/ooxml/OOXMLFastContextHandler.cxx:227:9 > LibreOffice#27 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27 > LibreOffice#28 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1338:17 > LibreOffice#29 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18 > LibreOffice#30 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11254:8 > LibreOffice#31 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:11636:5 > LibreOffice#32 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1117:25 > LibreOffice#33 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:896:9 > LibreOffice#34 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1477:13 > LibreOffice#35 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at sw/source/writerfilter/ooxml/OOXMLDocumentImpl.cxx:514:18 > LibreOffice#36 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sw/source/writerfilter/filter/WriterFilter.cxx:210:24 > LibreOffice#37 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2719:34 > LibreOffice#38 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:767:23 > LibreOffice#39 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1991:36 > LibreOffice#40 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:725:28 > LibreOffice#41 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1180:37 > LibreOffice#42 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:415:20 > LibreOffice#43 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) at framework/source/loadenv/loadenv.cxx:311:5 > LibreOffice#44 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:167:14 > LibreOffice#45 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:592:16 > LibreOffice#46 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx > LibreOffice#47 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:72:62 > LibreOffice#48 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:126:19 > LibreOffice#49 in UnoApiTest::loadFromURL(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:108:5 > LibreOffice#50 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) at sw/qa/unit/swmodeltestbase.cxx:384:5 > LibreOffice#51 in SwModelTestBase::createSwDoc(char const*, char const*) at sw/qa/unit/swmodeltestbase.cxx:433:9 > LibreOffice#52 in (anonymous namespace)::testtdf91095::TestBody() at sw/qa/extras/docbookexport/docbookexport.cxx:35:5 Change-Id: I1e6d6888c8b311988e627845107148c7970fbaab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179502 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
1 parent 3a28b69 commit b5f3756

6 files changed

Lines changed: 147 additions & 182 deletions

File tree

‎sw/inc/calbck.hxx‎

Lines changed: 45 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <svl/hint.hxx>
2525
#include <svl/broadcast.hxx>
2626
#include <svl/poolitem.hxx>
27-
#include <tools/debug.hxx>
2827
#include "swdllapi.h"
2928
#include "ring.hxx"
3029
#include <type_traits>
@@ -65,18 +64,10 @@ class SwFindNearestNode;
6564
This is still subject to refactoring.
6665
*/
6766

68-
6967
namespace sw
7068
{
7169
class ClientIteratorBase;
7270
class ListenerEntry;
73-
enum class IteratorMode { Exact, UnwrapMulti };
74-
}
75-
76-
template<typename TElementType, typename TSource, sw::IteratorMode eMode> class SwIterator;
77-
78-
namespace sw
79-
{
8071
void ClientNotifyAttrChg(SwModify& rModify, const SwAttrSet& aSet, SwAttrSet& aOld, SwAttrSet& aNew);
8172
struct SAL_DLLPUBLIC_RTTI LegacyModifyHint final: SfxHint
8273
{
@@ -135,58 +126,52 @@ namespace sw
135126
virtual const SwRowFrame* DynCastRowFrame() const { return nullptr; }
136127
virtual const SwTable* DynCastTable() const { return nullptr; }
137128
};
129+
enum class IteratorMode { Exact, UnwrapMulti };
130+
}
138131

139-
template<typename T>
140-
class SW_DLLPUBLIC ClientBase : public ::sw::WriterListener
141-
{
142-
// avoids making the details of the linked list and the callback method public
143-
friend class ::SwModify;
144-
friend class sw::ClientIteratorBase;
145-
friend class sw::ListenerEntry;
146-
template<typename E, typename S, sw::IteratorMode> friend class ::SwIterator;
147-
148-
T *m_pRegisteredIn; ///< event source
132+
// SwClient
133+
class SW_DLLPUBLIC SwClient : public ::sw::WriterListener
134+
{
135+
// avoids making the details of the linked list and the callback method public
136+
friend class SwModify;
137+
friend class sw::ClientIteratorBase;
138+
friend class sw::ListenerEntry;
139+
template<typename E, typename S, sw::IteratorMode> friend class SwIterator;
149140

150-
protected:
151-
// single argument ctors shall be explicit.
152-
inline explicit ClientBase( T* pToRegisterIn )
153-
: m_pRegisteredIn( nullptr )
154-
{
155-
if(pToRegisterIn)
156-
pToRegisterIn->Add(*this);
157-
}
141+
SwModify *m_pRegisteredIn; ///< event source
158142

159-
// write access to pRegisteredIn shall be granted only to the object itself (protected access)
160-
T* GetRegisteredInNonConst() const { return m_pRegisteredIn; }
143+
protected:
144+
// single argument ctors shall be explicit.
145+
inline explicit SwClient( SwModify* pToRegisterIn );
161146

162-
// when overriding this, you MUST call SwClient::SwClientNotify() in the override!
163-
virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
147+
// write access to pRegisteredIn shall be granted only to the object itself (protected access)
148+
SwModify* GetRegisteredInNonConst() const { return m_pRegisteredIn; }
164149

165-
public:
166-
ClientBase() : m_pRegisteredIn(nullptr) {}
167-
ClientBase(ClientBase&&) noexcept;
168-
virtual ~ClientBase() override;
150+
// when overriding this, you MUST call SwClient::SwClientNotify() in the override!
151+
virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
169152

153+
public:
154+
SwClient() : m_pRegisteredIn(nullptr) {}
155+
SwClient(SwClient&&) noexcept;
156+
virtual ~SwClient() override;
170157

171-
// in case an SwModify object is destroyed that itself is registered in another SwModify,
172-
// its SwClient objects can decide to get registered to the latter instead by calling this method
173-
std::optional<sw::ModifyChangedHint> CheckRegistration( const SfxPoolItem* pOldValue );
174-
// SwFormat wants to die different than the rest: It wants to reparent every client to its parent
175-
// and then send a SwFormatChg hint.
176-
void CheckRegistrationFormat(SwFormat& rOld);
177158

178-
const T* GetRegisteredIn() const { return m_pRegisteredIn; }
179-
T* GetRegisteredIn() { return m_pRegisteredIn; }
180-
void EndListeningAll();
181-
void StartListeningToSameModifyAs(const ClientBase&);
159+
// in case an SwModify object is destroyed that itself is registered in another SwModify,
160+
// its SwClient objects can decide to get registered to the latter instead by calling this method
161+
std::optional<sw::ModifyChangedHint> CheckRegistration( const SfxPoolItem* pOldValue );
162+
// SwFormat wants to die different than the rest: It wants to reparent every client to its parent
163+
// and then send a SwFormatChg hint.
164+
void CheckRegistrationFormat(SwFormat& rOld);
182165

166+
const SwModify* GetRegisteredIn() const { return m_pRegisteredIn; }
167+
SwModify* GetRegisteredIn() { return m_pRegisteredIn; }
168+
void EndListeningAll();
169+
void StartListeningToSameModifyAs(const SwClient&);
183170

184-
// get information about attribute
185-
virtual bool GetInfo( SwFindNearestNode& ) const { return true; }
186-
};
187-
}
188171

189-
typedef sw::ClientBase<SwModify> SwClient;
172+
// get information about attribute
173+
virtual bool GetInfo( SwFindNearestNode& ) const { return true; }
174+
};
190175

191176

192177
// SwModify
@@ -196,13 +181,12 @@ class SW_DLLPUBLIC SwModify: public SwClient
196181
{
197182
friend class sw::ClientIteratorBase;
198183
friend void sw::ClientNotifyAttrChg(SwModify&, const SwAttrSet&, SwAttrSet&, SwAttrSet&);
199-
template<typename E, typename S, sw::IteratorMode> friend class ::SwIterator;
184+
template<typename E, typename S, sw::IteratorMode> friend class SwIterator;
200185
sw::WriterListener* m_pWriterListeners; // the start of the linked list of clients
201186
bool m_bModifyLocked; // don't broadcast changes now
202187

203188
SwModify(SwModify const &) = delete;
204189
SwModify &operator =(const SwModify&) = delete;
205-
void EnsureBroadcasting();
206190
protected:
207191
virtual void SwClientNotify(const SwModify&, const SfxHint& rHint) override;
208192
public:
@@ -215,8 +199,8 @@ public:
215199

216200
virtual ~SwModify() override;
217201

218-
template<typename T> void Add(sw::ClientBase<T>& rDepend);
219-
template<typename T> void Remove(sw::ClientBase<T>& rDepend);
202+
void Add(SwClient& rDepend);
203+
void Remove(SwClient& rDepend);
220204
bool HasWriterListeners() const { return m_pWriterListeners; }
221205
bool HasOnlyOneListener() const { return m_pWriterListeners && m_pWriterListeners->IsLast(); }
222206

@@ -228,6 +212,7 @@ public:
228212
bool IsModifyLocked() const { return m_bModifyLocked; }
229213
};
230214

215+
template<typename TElementType, typename TSource, sw::IteratorMode eMode> class SwIterator;
231216

232217
namespace sw
233218
{
@@ -291,7 +276,8 @@ namespace sw
291276
};
292277
class ClientIteratorBase : public sw::Ring< ::sw::ClientIteratorBase >
293278
{
294-
friend class ::SwModify;
279+
friend void SwModify::Remove(SwClient&);
280+
friend void SwModify::Add(SwClient&);
295281
protected:
296282
const SwModify& m_rRoot;
297283
// the current object in an iteration
@@ -435,77 +421,11 @@ public:
435421
using sw::ClientIteratorBase::IsChanged;
436422
};
437423

438-
template<typename T>
439-
void SwModify::Add(sw::ClientBase<T>& rDepend)
424+
SwClient::SwClient( SwModify* pToRegisterIn )
425+
: m_pRegisteredIn( nullptr )
440426
{
441-
DBG_TESTSOLARMUTEX();
442-
#ifdef DBG_UTIL
443-
EnsureBroadcasting();
444-
assert(dynamic_cast<T*>(this));
445-
#endif
446-
447-
if (rDepend.GetRegisteredIn() == this)
448-
return;
449-
450-
// deregister new client in case it is already registered elsewhere
451-
if( rDepend.GetRegisteredIn() != nullptr )
452-
rDepend.m_pRegisteredIn->Remove(rDepend);
453-
454-
if( !m_pWriterListeners )
455-
{
456-
// first client added
457-
m_pWriterListeners = &rDepend;
458-
m_pWriterListeners->m_pLeft = nullptr;
459-
m_pWriterListeners->m_pRight = nullptr;
460-
}
461-
else
462-
{
463-
// append client
464-
rDepend.m_pRight = m_pWriterListeners->m_pRight;
465-
m_pWriterListeners->m_pRight = &rDepend;
466-
rDepend.m_pLeft = m_pWriterListeners;
467-
if( rDepend.m_pRight )
468-
rDepend.m_pRight->m_pLeft = &rDepend;
469-
}
470-
471-
// connect client to me
472-
rDepend.m_pRegisteredIn = static_cast<T*>(this);
427+
if(pToRegisterIn)
428+
pToRegisterIn->Add(*this);
473429
}
474430

475-
template<typename T>
476-
void SwModify::Remove(sw::ClientBase<T>& rDepend)
477-
{
478-
DBG_TESTSOLARMUTEX();
479-
assert(rDepend.m_pRegisteredIn == this);
480-
481-
// SwClient is my listener
482-
// remove it from my list
483-
::sw::WriterListener* pR = rDepend.m_pRight;
484-
::sw::WriterListener* pL = rDepend.m_pLeft;
485-
if( m_pWriterListeners == &rDepend )
486-
m_pWriterListeners = pL ? pL : pR;
487-
488-
if( pL )
489-
pL->m_pRight = pR;
490-
if( pR )
491-
pR->m_pLeft = pL;
492-
493-
// update ClientIterators
494-
if(sw::ClientIteratorBase::s_pClientIters)
495-
{
496-
for(auto& rIter : sw::ClientIteratorBase::s_pClientIters->GetRingContainer())
497-
{
498-
if (&rIter.m_rRoot == this &&
499-
(rIter.m_pCurrent == &rDepend || rIter.m_pPosition == &rDepend))
500-
{
501-
// if object being removed is the current or next object in an
502-
// iterator, advance this iterator
503-
rIter.m_pPosition = pR;
504-
}
505-
}
506-
}
507-
rDepend.m_pLeft = nullptr;
508-
rDepend.m_pRight = nullptr;
509-
rDepend.m_pRegisteredIn = nullptr;
510-
}
511431
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

‎sw/inc/fmthdft.hxx‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,12 @@
2525
#include "calbck.hxx"
2626
#include "frmfmt.hxx"
2727

28-
namespace sw {
29-
typedef ClientBase<::SwFrameFormat> FrameFormatClient;
30-
}
31-
3228
class IntlWrapper;
3329

3430
/** Header, for PageFormats
3531
Client of FrameFormat describing the header. */
3632

37-
class SW_DLLPUBLIC SwFormatHeader final : public SfxPoolItem, public sw::FrameFormatClient
33+
class SW_DLLPUBLIC SwFormatHeader final : public SfxPoolItem, public SwClient
3834
{
3935
bool m_bActive; ///< Only for controlling (creation of content).
4036

@@ -55,18 +51,18 @@ public:
5551
OUString &rText,
5652
const IntlWrapper& rIntl ) const override;
5753

58-
const SwFrameFormat *GetHeaderFormat() const { return GetRegisteredIn(); }
59-
SwFrameFormat *GetHeaderFormat() { return GetRegisteredIn(); }
54+
const SwFrameFormat *GetHeaderFormat() const { return static_cast<const SwFrameFormat*>(GetRegisteredIn()); }
55+
SwFrameFormat *GetHeaderFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
6056

61-
void RegisterToFormat( SwFrameFormat& rFormat );
57+
void RegisterToFormat( SwFormat& rFormat );
6258
bool IsActive() const { return m_bActive; }
6359
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
6460
};
6561

6662
/**Footer, for pageformats
6763
Client of FrameFormat describing the footer */
6864

69-
class SW_DLLPUBLIC SwFormatFooter final : public SfxPoolItem, public sw::FrameFormatClient
65+
class SW_DLLPUBLIC SwFormatFooter final : public SfxPoolItem, public SwClient
7066
{
7167
bool m_bActive; // Only for controlling (creation of content).
7268

@@ -87,8 +83,8 @@ public:
8783
OUString &rText,
8884
const IntlWrapper& rIntl ) const override;
8985

90-
const SwFrameFormat *GetFooterFormat() const { return GetRegisteredIn(); }
91-
SwFrameFormat *GetFooterFormat() { return GetRegisteredIn(); }
86+
const SwFrameFormat *GetFooterFormat() const { return static_cast<const SwFrameFormat*>(GetRegisteredIn()); }
87+
SwFrameFormat *GetFooterFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
9288

9389
void RegisterToFormat( SwFormat& rFormat );
9490
bool IsActive() const { return m_bActive; }

‎sw/inc/ring.hxx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#ifndef INCLUDED_SW_INC_RING_HXX
2020
#define INCLUDED_SW_INC_RING_HXX
2121

22-
#include <cassert>
2322
#include <utility>
2423
#include <sal/types.h>
2524
#include <iterator>

0 commit comments

Comments
 (0)