Kaydet (Commit) b1704274 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Caolán McNamara

Wrong dynamic_cast

EditCharAttrib doesn't inherit from or related to SvxFieldItem
Moreover, we can see lines like this:
const SvxFieldItem* pFieldItem = dynamic_cast<const SvxFieldItem*>(pAttr->GetItem());

Change-Id: I9f5710dc4a9a4e71d31538620a9ddc1dedee063f
Reviewed-on: https://gerrit.libreoffice.org/19575Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst e3f21e63
......@@ -3175,7 +3175,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
{
const EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature(nIndex);
DBG_ASSERT( pAttr, "Field not found");
DBG_ASSERT( dynamic_cast< const SvxFieldItem* >( pAttr ) != nullptr, "Field of the wrong type! ");
DBG_ASSERT( dynamic_cast< const EditCharAttribField* >( pAttr ) != nullptr, "Field of the wrong type! ");
aText = static_cast<const EditCharAttribField*>(pAttr)->GetFieldValue();
nTextStart = 0;
nTextLen = aText.getLength();
......@@ -3523,7 +3523,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
{
const EditCharAttrib* pAttr = pPortion->GetNode()->GetCharAttribs().FindFeature(nIndex);
DBG_ASSERT( pAttr, "Field not found" );
DBG_ASSERT( dynamic_cast< const SvxFieldItem* >( pAttr ) != nullptr, "Wrong type of field!" );
DBG_ASSERT( dynamic_cast< const EditCharAttribField* >( pAttr ) != nullptr, "Wrong type of field!" );
// add a meta file comment if we record to a metafile
if( bMetafileValid )
......
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