diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-06 10:41:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-06 11:32:54 +0100 |
commit | f37f08c9b59a4da5ce2145909a45922937b8ada8 (patch) | |
tree | 92624ab30a02b03ad0b39a6c06074c30f6f1cf31 | |
parent | ca1b74f647ebcd5eb8e7e6447d5b21b890d5460f (diff) |
coverity#705013 Unchecked dynamic_cast
Change-Id: I6dc2de6ab35e07f924204e2740003936cf6d4a0b
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index f34c1fab83e7..1ada1505814c 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3688,7 +3688,8 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) // the mark is still a DdeBookmark // we replace it with a Bookmark, so it will get saved etc. ::sw::mark::IMark* const pMark = ppMark->get(); - SwServerObject* const pServerObject = dynamic_cast<SwServerObject *>(&refObj); + ::sfx2::SvLinkSource* p = &refObj; + SwServerObject& rServerObject = dynamic_cast<SwServerObject&>(*p); // collecting state of old mark SwPaM aPaM(pMark->GetMarkStart()); @@ -3701,7 +3702,7 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) OUString sMarkName = pMark->GetName(); // remove mark - pServerObject->SetNoServer(); // this removes the connection between SwServerObject and mark + rServerObject.SetNoServer(); // this removes the connection between SwServerObject and mark // N.B. ppMark was not loaded from file and cannot have xml:id pMarkAccess->deleteMark(ppMark); @@ -3710,7 +3711,7 @@ bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm ) aPaM, sMarkName, IDocumentMarkAccess::BOOKMARK); - pServerObject->SetDdeBookmark(*pNewMark); + rServerObject.SetDdeBookmark(*pNewMark); } bDelBookmrk = false; |