Kaydet (Commit) 1bc19605 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1158079 Unchecked dynamic_cast

Change-Id: Iab2c78af7dcf967ccdf5016266324c805856af0b
üst 9d22ab17
......@@ -1036,13 +1036,13 @@ SwTxtAttr* MakeTxtAttr(
case RES_TXTATR_ANNOTATION:
{
pNew = new SwTxtAnnotationFld( static_cast<SwFmtFld &>(rNew), nStt, rDoc.IsClipBoard() );
if ( bIsCopy == COPY )
if (bIsCopy == COPY)
{
// On copy of the annotation field do not keep the annotated text range by removing
// the relation to its annotation mark (relation established via annotation field's name).
// If the annotation mark is also copied, the relation and thus the annotated text range will be reestablished,
// when the annotation mark is created and inserted into the document.
const_cast<SwPostItField*>(dynamic_cast< const SwPostItField* >(pNew->GetFmtFld().GetField()))->SetName( OUString() );
const_cast<SwPostItField&>(dynamic_cast<const SwPostItField&>(*(pNew->GetFmtFld().GetField()))).SetName(OUString());
}
}
break;
......
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