[Libreoffice-commits] core.git: 11 commits - basctl/source idl/source sal/qa sd/qa sfx2/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Fri May 9 01:43:45 PDT 2014


 basctl/source/basicide/baside2b.cxx      |    2 +-
 idl/source/objects/slot.cxx              |    2 +-
 idl/source/objects/types.cxx             |    2 +-
 sal/qa/checkapi/strings.cxx              |    4 ++--
 sal/qa/osl/module/osl_Module_DLL.cxx     |    4 ++--
 sd/qa/unit/import-tests.cxx              |    1 -
 sfx2/source/view/viewfrm.cxx             |    7 ++-----
 svx/source/form/filtnav.cxx              |    8 +++-----
 svx/source/svdraw/svdedtv2.cxx           |    4 ++--
 sw/source/core/uibase/uiview/viewprt.cxx |    2 +-
 sw/source/filter/ww8/docxsdrexport.cxx   |    2 +-
 sw/source/filter/ww8/ww8graf.cxx         |    2 +-
 12 files changed, 17 insertions(+), 23 deletions(-)

New commits:
commit 52cd5ccc127f6c53be834072032827bb28759c6e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:33:07 2014 +0100

    coverity#1209760 Parse warning
    
    Change-Id: I380cae18964ee6ed7d8ef87d9ae861cc7b34c376

diff --git a/sal/qa/checkapi/strings.cxx b/sal/qa/checkapi/strings.cxx
index 3075802..9e11ea2 100644
--- a/sal/qa/checkapi/strings.cxx
+++ b/sal/qa/checkapi/strings.cxx
@@ -23,9 +23,9 @@
 #include "sal_allheaders.hxx"
 
 CPPUNIT_PLUGIN_IMPLEMENT();
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL firstfunc( sal_Bool bRes )
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL firstfunc( sal_Bool )
 {
-   return ( bRes = sal_True );
+   return sal_True;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/osl/module/osl_Module_DLL.cxx b/sal/qa/osl/module/osl_Module_DLL.cxx
index e33f651..23e930e 100644
--- a/sal/qa/osl/module/osl_Module_DLL.cxx
+++ b/sal/qa/osl/module/osl_Module_DLL.cxx
@@ -27,9 +27,9 @@
 // But we instatiate a test plugin to fake the build process.
 CPPUNIT_PLUGIN_IMPLEMENT();
 
-extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL firstfunc( sal_Bool bRes )
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL firstfunc( sal_Bool )
 {
-   return ( bRes = sal_True );
+   return sal_True;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 785ad9bda1dc289e9f0b197b13d73dacb6c60fbd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:30:36 2014 +0100

    coverity#1209783 Dereference before null check
    
    Change-Id: Idac50085b04a2520b87bb4912e24fe59eae0a372

diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index da3cfbb..3ac2e76 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2823,7 +2823,7 @@ SwFlyFrmFmt* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject,
         MatchSdrItemsIntoFlySet( rpObject, rFlySet, pRecord->eLineStyle,
             pRecord->eLineDashing, pRecord->eShapeType, aInnerDist );
 
-        SdrTextObj *pSdrTextObj = PTR_CAST(SdrTextObj, rpObject);
+        SdrTextObj *pSdrTextObj = dynamic_cast<SdrTextObj*>(rpObject);
         if (pSdrTextObj && pSdrTextObj->IsVerticalWriting())
             rFlySet.Put(SvxFrameDirectionItem(FRMDIR_VERT_TOP_RIGHT, RES_FRAMEDIR));
 
commit 3697e91ea6f26b75c0bd7a067a8ed9488aa656f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:29:26 2014 +0100

    coverity#1209785 Dereference before null check
    
    Change-Id: Iff8553169bd4670d989b45ce488a0cd2b13e0cf3

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 217ff18..a32d883 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -658,11 +658,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                 if( pSalvageItem )
                 {
                     aURL = pSalvageItem->GetValue();
-                    if (pNewSet)
-                    {
-                        pNewSet->ClearItem( SID_ORIGURL );
-                        pNewSet->ClearItem( SID_DOC_SALVAGE );
-                    }
+                    pNewSet->ClearItem( SID_ORIGURL );
+                    pNewSet->ClearItem( SID_DOC_SALVAGE );
                 }
 
 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
commit 0d7b898bf7b98116a8654e4754ae7bdd3fe7b21e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:25:56 2014 +0100

    coverity#1209786 Dereference before null check
    
    Change-Id: I98bb62bbcb7ffbd2896ddbcbaeea27fff0851653

diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx
index cf9cfa9..fbf7f35 100644
--- a/idl/source/objects/types.cxx
+++ b/idl/source/objects/types.cxx
@@ -388,7 +388,7 @@ sal_uLong SvMetaAttribute::MakeSlotValue( SvIdlDataBase & rBase, bool bVar ) con
         n = n << 20;
         n += rBase.aStructSlotId.GetValue();
     }
-    if( PTR_CAST( SvMetaSlot, this ) )
+    if (dynamic_cast<const SvMetaSlot*>(this))
         n |= 0x20000;
     if( !bVar )
         n += 0x10000;
commit 0baedc980495bc07491906f1bac4acf3ad040f94
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:23:28 2014 +0100

    coverity#1209792 Dereference before null check
    
    Change-Id: Ie4ff7acb0b9116fbdab42c6bc0088a43e98871fc

diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index e002069..d774574 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1404,11 +1404,9 @@ namespace
     FmFilterItems* getTargetItems(SvTreeListEntry* _pTarget)
     {
         FmFilterData*   pData = static_cast<FmFilterData*>(_pTarget->GetUserData());
-        FmFilterItems*  pTargetItems = pData->ISA(FmFilterItems)
-                                        ?
-                                        PTR_CAST(FmFilterItems,pData)
-                                        :
-                                    PTR_CAST(FmFilterItems,pData->GetParent());
+        FmFilterItems*  pTargetItems = dynamic_cast<FmFilterItems*>(pData);
+        if (!pTargetItems)
+            pTargetItems = dynamic_cast<FmFilterItems*>(pData->GetParent());
         return pTargetItems;
     }
 }
commit 0698ccf040c8805cb0e33e3786c5780f6048a5ca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:20:04 2014 +0100

    coverity#1209793 Dereference before null check
    
    Change-Id: I5c89f7291117d66ff07f7d686c7030396cb504df

diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 538d0af..2d9de32 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -1020,7 +1020,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
                 SvMetaAttribute * pAttr = rBase.GetAttrList()[m];
                 if (aSId.equals(pAttr->GetSlotId().getString()))
                 {
-                    SvMetaSlot* pSlot = PTR_CAST( SvMetaSlot, pAttr );
+                    SvMetaSlot* pSlot = dynamic_cast<SvMetaSlot*>(pAttr);
                     xEnumSlot = pSlot->Clone();
                     break;
                 }
commit 1732919a6e434adca31d4a9d4daa95e19e14c342
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:19:12 2014 +0100

    coverity#1209803 Dereference before null check
    
    Change-Id: Ie6435770edc709feba2ad191e00e03d637cf6154

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index c0897d5..640c51f 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -541,7 +541,6 @@ void SdFiltersTest::testFdo72998()
         SdrObjCustomShape *pObj = dynamic_cast<SdrObjCustomShape *>(pPage->GetObj(2));
         CPPUNIT_ASSERT( pObj );
         const SdrCustomShapeGeometryItem& rGeometryItem = (const SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
-        CPPUNIT_ASSERT_MESSAGE( "not a custom shape", pObj );
         const ::com::sun::star::uno::Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( OUString( "ViewBox" ) );
         CPPUNIT_ASSERT_MESSAGE( "Missing ViewBox", pViewBox );
         com::sun::star::awt::Rectangle aViewBox;
commit d4e346b0488bf8cd3e9f5203e0833b06d478bee7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:17:52 2014 +0100

    coverity#1209804 Dereference before null check
    
    Change-Id: Ie32f71b0f089c0687807f1ef2329f41b35ecf076

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index f47a615..b253ef7 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -724,7 +724,7 @@ void DocxSdrExport::writeDMLAndVMLDrawing(const SdrObject* sdrObj, const SwFrmFm
     {
         m_pImpl->m_pSerializer->startElementNS(XML_mc, XML_AlternateContent, FSEND);
 
-        const SdrObjGroup* pObjGroup = PTR_CAST(SdrObjGroup, sdrObj);
+        const SdrObjGroup* pObjGroup = dynamic_cast<const SdrObjGroup*>(sdrObj);
         m_pImpl->m_pSerializer->startElementNS(XML_mc, XML_Choice,
                                                XML_Requires, (pObjGroup ? "wpg" : "wps"),
                                                FSEND);
commit 13c01aac250da64241d780cb6fb8ed173c517f06
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:12:23 2014 +0100

    coverity#1209811 Dereference before null check
    
    Change-Id: I7e3778e5203438bc5db942c813a03896d7df895b

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 20b46d0..93e0f04 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1136,7 +1136,7 @@ OUString EditorWindow::GetActualSubName( sal_uLong nLine )
     for( sal_uInt16 i=0; i < pMethods->Count(); i++ )
     {
         SbxVariable* p = PTR_CAST( SbMethod, pMethods->Get( i ) );
-        SbMethod* pMeth = p ? PTR_CAST( SbMethod, p ) : NULL;
+        SbMethod* pMeth = PTR_CAST( SbMethod, p );
         if( pMeth )
         {
             sal_uInt16 l1,l2;
commit 6300794a2c896aa003b00cb979d1985843385a01
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:09:14 2014 +0100

    coverity#1209816 Dereference before null check
    
    Change-Id: I125daf37f07c7b84289625d046abe8257c82e8d4

diff --git a/sw/source/core/uibase/uiview/viewprt.cxx b/sw/source/core/uibase/uiview/viewprt.cxx
index 496b487..f29c7b8 100644
--- a/sw/source/core/uibase/uiview/viewprt.cxx
+++ b/sw/source/core/uibase/uiview/viewprt.cxx
@@ -75,7 +75,7 @@ SfxPrinter* SwView::GetPrinter( bool bCreate )
     SfxPrinter *pPrt = pIDDA->getPrinter( bCreate );
     if ( pOld != pPrt )
     {
-        bool bWeb = 0 != PTR_CAST(SwWebView, this);
+        bool bWeb = 0 != dynamic_cast<SwWebView*>(this);
         ::SetAppPrintOptions( &GetWrtShell(), bWeb );
     }
     return pPrt;
commit 3f0116e0e07a9524f7ab6f6f56f71cb53ab45d77
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri May 9 09:07:58 2014 +0100

    coverity#1209818 Dereference before null check
    
    Change-Id: I0d94e599818df19411de8e58b99bb9f5735f973a

diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index d6802ec..17d20c1 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1418,8 +1418,8 @@ bool SdrEditView::ImpCanDismantle(const SdrObject* pObj, bool bMakeLines) const
     }
     else
     {
-        const SdrPathObj* pPath = PTR_CAST(SdrPathObj, pObj);
-        const SdrObjCustomShape* pCustomShape = PTR_CAST(SdrObjCustomShape, pObj);
+        const SdrPathObj* pPath = dynamic_cast<const SdrPathObj*>(pObj);
+        const SdrObjCustomShape* pCustomShape = dynamic_cast<const SdrObjCustomShape*>(pObj);
 
         // #i37011#
         if(pPath)


More information about the Libreoffice-commits mailing list