[Libreoffice-commits] core.git: editeng/source

Julien Nabet serval2412 at yahoo.fr
Tue Nov 3 01:56:51 PST 2015


 editeng/source/editeng/impedit3.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b1704274d3214405aa154a4b52c2ebe1901e5fa3
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Oct 24 16:04:37 2015 +0200

    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/19575
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index a3b6ef6..45c7c34 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -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 )


More information about the Libreoffice-commits mailing list