Kaydet (Commit) 470843ff authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#705043 Unchecked dynamic_cast

Change-Id: I554cda341894bbf35c16cdf0d9eb77ffea32f5e2
üst c44c569a
...@@ -338,8 +338,8 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range, ...@@ -338,8 +338,8 @@ SwVbaFields::Add( const css::uno::Reference< ::ooo::vba::word::XRange >& Range,
throw uno::RuntimeException("Not implemented" ); throw uno::RuntimeException("Not implemented" );
} }
SwVbaRange* pVbaRange = dynamic_cast< SwVbaRange* >( Range.get() ); SwVbaRange& rVbaRange = dynamic_cast<SwVbaRange&>(*Range.get());
uno::Reference< text::XTextRange > xTextRange = pVbaRange->getXTextRange(); uno::Reference< text::XTextRange > xTextRange = rVbaRange.getXTextRange();
uno::Reference< text::XText > xText = xTextRange->getText(); uno::Reference< text::XText > xText = xTextRange->getText();
xText->insertTextContent( xTextRange, xTextField, true ); xText->insertTextContent( xTextRange, xTextField, true );
return uno::Reference< word::XField >( new SwVbaField( mxParent, mxContext, uno::Reference< text::XTextDocument >( mxModel, uno::UNO_QUERY_THROW ), uno::Reference< text::XTextField >( xTextField, uno::UNO_QUERY_THROW ) ) ); return uno::Reference< word::XField >( new SwVbaField( mxParent, mxContext, uno::Reference< text::XTextDocument >( mxModel, uno::UNO_QUERY_THROW ), uno::Reference< text::XTextField >( xTextField, uno::UNO_QUERY_THROW ) ) );
......
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