diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-25 12:14:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-25 12:14:17 +0100 |
commit | 0316c6c2d32245bad601aa74d8e42b21a427f9d2 (patch) | |
tree | 319f796b88506003b74f527767556b992217abf3 /sw/source | |
parent | 15b406f0736ad953aa79102bfa5949871c8c0213 (diff) |
Avoid unnecessary bad downcasts to SwCharFmt
At least in JunitTest_sw_unoapi it happens that this downcast is called from
~SwCharFmt -> ~SwFmt -> SwClient::ModifyNotification -> SwDepend::Modify ->
SwClient::ModifyNotification -> SwEndNodeInfo::Modify, i.e., the downcasted
object is in destruction and no longer an SwCharFmt but only an SwFmt. Whether
or not that chain of calls is actually sane---casting down to merely an SwFmt
is a quickfix at least.
Change-Id: I33f0d76c42daa2530b8d417df059de57190c5070
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/docftn.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx index e440e0aa8b40..1b9c1beb6b3c 100644 --- a/sw/source/core/doc/docftn.cxx +++ b/sw/source/core/doc/docftn.cxx @@ -193,9 +193,9 @@ void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { SwDoc* pDoc; if( aCharFmtDep.GetRegisteredIn() ) - pDoc = static_cast<SwCharFmt*>(aCharFmtDep.GetRegisteredIn())->GetDoc(); + pDoc = static_cast<SwFmt*>(aCharFmtDep.GetRegisteredIn())->GetDoc(); else - pDoc = static_cast<SwCharFmt*>(aAnchorCharFmtDep.GetRegisteredIn())->GetDoc(); + pDoc = static_cast<SwFmt*>(aAnchorCharFmtDep.GetRegisteredIn())->GetDoc(); SwFtnIdxs& rFtnIdxs = pDoc->GetFtnIdxs(); for( size_t nPos = 0; nPos < rFtnIdxs.size(); ++nPos ) { |