Kaydet (Commit) 0316c6c2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 15b406f0
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment