[Libreoffice-commits] core.git: 6 commits - connectivity/source extensions/source hwpfilter/source lotuswordpro/source rsc/source sax/source sc/source sd/source stoc/source stoc/test svtools/source svx/source sw/source

Caolán McNamara caolanm at redhat.com
Wed Apr 29 02:13:18 PDT 2015


 connectivity/source/drivers/kab/KPreparedStatement.cxx       |    2 -
 connectivity/source/drivers/macab/MacabPreparedStatement.cxx |    2 -
 extensions/source/bibliography/bibload.cxx                   |    2 -
 hwpfilter/source/hgzip.cxx                                   |   11 +++----
 lotuswordpro/source/filter/lwpfilter.cxx                     |    2 -
 rsc/source/rscpp/cpp2.c                                      |    2 -
 sax/source/expatwrap/saxwriter.cxx                           |    2 -
 sc/source/filter/xml/xmlwrap.cxx                             |    3 -
 sd/source/core/drawdoc.cxx                                   |    2 -
 sd/source/core/drawdoc3.cxx                                  |   10 +++---
 sd/source/filter/eppt/pptx-text.cxx                          |    2 -
 sd/source/filter/ppt/pptin.cxx                               |   12 +++----
 sd/source/filter/ppt/pptinanimations.cxx                     |    2 -
 stoc/source/inspect/introspection.cxx                        |   17 ++++-------
 stoc/source/servicemanager/servicemanager.cxx                |    4 +-
 stoc/test/testintrosp.cxx                                    |    4 +-
 svtools/source/contnr/imivctl1.cxx                           |    2 -
 svx/source/table/svdotable.cxx                               |    4 --
 sw/source/core/crsr/crsrsh.cxx                               |    2 -
 sw/source/core/text/frmcrsr.cxx                              |   14 ++++-----
 20 files changed, 48 insertions(+), 53 deletions(-)

New commits:
commit 73faf2c068b793dd05ddc66b562e8ac27b2745cd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 10:03:37 2015 +0100

    cppcheck: cstyleCast
    
    Change-Id: I0868793be316b0648f91b566705ad1c63951fd1d

diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index c949cc6..52b1edd 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -2219,11 +2219,9 @@ void SdrTableObj::AddToHdlList(SdrHdlList& rHdlList) const
 
     const size_t nHdlCount = rHdlList.GetHdlCount();
     for( size_t nHdl = 0; nHdl < nHdlCount; ++nHdl )
-        rHdlList.GetHdl(nHdl)->SetObj((SdrObject*)this);
+        rHdlList.GetHdl(nHdl)->SetObj(const_cast<SdrTableObj*>(this));
 }
 
-
-
 SdrHdl* SdrTableObj::GetHdl(sal_uInt32 nHdlNum) const
 {
     // #i73248#
commit e0380df3ee1db7950be6ae5f03403fe4fbc07d7a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 09:51:16 2015 +0100

    sequence operator twaddle + silly cast
    
    Change-Id: I8804bfb39d8306762cbe39ac4b6df9128a8e0069

diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index c1eee13..9d78c4d 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -82,7 +82,8 @@ gz_stream *gz_open(HStream & _stream)
 
     if (err != Z_OK || s->inbuf == Z_NULL)
     {
-        return destroy(s), (gz_stream *) Z_NULL;
+        destroy(s);
+        return Z_NULL;
     }
 
     s->stream.avail_out = Z_BUFSIZE;
commit 626fe1669f7062e04db60ce7757d1c7d32842b3a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 09:42:07 2015 +0100

    redundant cast
    
    Change-Id: Ib812a7cafabc4820946da67fb3f8896b6aad1461

diff --git a/connectivity/source/drivers/kab/KPreparedStatement.cxx b/connectivity/source/drivers/kab/KPreparedStatement.cxx
index 7157ad2..1d9853d 100644
--- a/connectivity/source/drivers/kab/KPreparedStatement.cxx
+++ b/connectivity/source/drivers/kab/KPreparedStatement.cxx
@@ -39,7 +39,7 @@ void KabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) throw(SQL
         m_aParameterRow = new OValueVector();
 
     if (nParams < 1)
-        ::dbtools::throwInvalidIndexException(*(KabPreparedStatement *) this,Any());
+        ::dbtools::throwInvalidIndexException(*this, Any());
 
     if (nParams >= (sal_Int32) (m_aParameterRow->get()).size())
         (m_aParameterRow->get()).resize(nParams);
diff --git a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
index 2c6a96b..600b3ce 100644
--- a/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
+++ b/connectivity/source/drivers/macab/MacabPreparedStatement.cxx
@@ -40,7 +40,7 @@ void MacabPreparedStatement::checkAndResizeParameters(sal_Int32 nParams) throw(S
         m_aParameterRow = new OValueVector();
 
     if (nParams < 1)
-        ::dbtools::throwInvalidIndexException(*(MacabPreparedStatement *) this,Any());
+        ::dbtools::throwInvalidIndexException(*this, Any());
 
     if (nParams >= (sal_Int32) (m_aParameterRow->get()).size())
         (m_aParameterRow->get()).resize(nParams);
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index afa6cb0..bee83d8 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -449,7 +449,7 @@ Any BibliographyLoader::getByName(const OUString& rName) throw
     Any aRet;
     try
     {
-        BibDataManager* pDatMan = ((BibliographyLoader*)this)->GetDataManager();
+        BibDataManager* pDatMan = GetDataManager();
         Reference< XResultSet >  xCursor = GetDataCursor();
         Reference< sdbcx::XColumnsSupplier >  xSupplyCols(xCursor, UNO_QUERY);
         Reference< XNameAccess >  xColumns;
diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx
index fa11f6f..c1eee13 100644
--- a/hwpfilter/source/hgzip.cxx
+++ b/hwpfilter/source/hgzip.cxx
@@ -90,7 +90,7 @@ gz_stream *gz_open(HStream & _stream)
     errno = 0;
     s->_inputstream = &_stream;
 
-    return (gz_stream *) s;
+    return s;
 }
 
 
@@ -156,7 +156,7 @@ local int destroy(gz_stream * s)
 int gz_read(gz_stream * file, voidp buf, unsigned len)
 {
 //printf("@@ gz_read : len : %d\t",len);
-    gz_stream *s = (gz_stream *) file;
+    gz_stream *s = file;
     Bytef *start = static_cast<Bytef *>(buf);                 /* starting point for crc computation */
     Byte *next_out;                               /* == stream.next_out but not forced far (for MSDOS) */
     if (s == NULL)
@@ -242,7 +242,7 @@ int gz_flush(gz_stream * file, int flush)
 {
     uInt len;
     bool done = false;
-    gz_stream *s = (gz_stream *) file;
+    gz_stream *s = file;
 
     if (s == NULL || s->mode != 'w')
         return Z_STREAM_ERROR;
@@ -304,7 +304,7 @@ local uLong getLong(gz_stream * s)
 int gz_close(gz_stream * file)
 {
 //  int err;
-    gz_stream *s = (gz_stream *) file;
+    gz_stream *s = file;
 
     if (s == NULL)
         return Z_STREAM_ERROR;
diff --git a/lotuswordpro/source/filter/lwpfilter.cxx b/lotuswordpro/source/filter/lwpfilter.cxx
index 9e66d7b..8f93df0 100644
--- a/lotuswordpro/source/filter/lwpfilter.cxx
+++ b/lotuswordpro/source/filter/lwpfilter.cxx
@@ -115,7 +115,7 @@ using namespace OpenStormBento;
     if (ulRet != BenErr_OK)
         return false;
 
-    boost::scoped_ptr<LtcUtBenValueStream> aWordProData((LtcUtBenValueStream *)pBentoContainer->FindValueStreamWithPropertyName("WordProData"));
+    boost::scoped_ptr<LtcUtBenValueStream> aWordProData(pBentoContainer->FindValueStreamWithPropertyName("WordProData"));
 
     if (!aWordProData.get())
         return false;
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index f3034577..fcf678e 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -672,7 +672,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
 
     for (sal_uInt16 nSdPage=0; nSdPage < nMaxSdPages; nSdPage++)
     {
-        SdPage* pPage = (SdPage*) GetSdPage(nSdPage, PK_STANDARD);
+        SdPage* pPage = GetSdPage(nSdPage, PK_STANDARD);
 
         if (pPage && !pPage->GetFileName().isEmpty() && pPage->GetBookmarkName().getLength())
         {
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 087010f..6853564 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1204,8 +1204,8 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
 
         if (!pMaster)
         {
-            pMaster = (SdPage*) GetMasterSdPage( (sal_uInt16) nMPage, PK_STANDARD );
-            pNotesMaster = (SdPage*) GetMasterSdPage( (sal_uInt16) nMPage, PK_NOTES );
+            pMaster = GetMasterSdPage( (sal_uInt16) nMPage, PK_STANDARD );
+            pNotesMaster = GetMasterSdPage( (sal_uInt16) nMPage, PK_NOTES );
         }
         else
         {
@@ -1235,7 +1235,7 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, bool bOnl
                 bDeleteMaster = false;
                 for (sal_uInt16 i = 0; i < GetMasterSdPageCount( PK_STANDARD ); i++)
                 {
-                    SdPage* pMPg = (SdPage*) GetMasterSdPage( i, PK_STANDARD );
+                    SdPage* pMPg = GetMasterSdPage( i, PK_STANDARD );
                     if( pMPg != pMaster &&
                         pMPg->GetLayoutName() == aLayoutName )
                     {
@@ -1432,8 +1432,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
         if (rLayoutName.isEmpty())
         {
             // No LayoutName: take first MasterPage
-            pMaster = (SdPage*) pSourceDoc->GetMasterSdPage(0, PK_STANDARD);
-            pNotesMaster = (SdPage*) pSourceDoc->GetMasterSdPage(0, PK_NOTES);
+            pMaster = pSourceDoc->GetMasterSdPage(0, PK_STANDARD);
+            pNotesMaster = pSourceDoc->GetMasterSdPage(0, PK_NOTES);
         }
         else
         {
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index a8c3e90..d5e1518 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -431,7 +431,7 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, bool bGe
 
 void PortionObj::ImplClear()
 {
-    delete (FieldEntry*)mpFieldEntry;
+    delete mpFieldEntry;
     delete[] mpText;
 }
 
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 4f40576..09dacec 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -564,7 +564,7 @@ bool ImplSdPPTImport::Import()
                 pPage->SetPageKind( ePgKind );
                 pSdrModel->InsertMasterPage( (SdrPage*)pPage );
                 if ( bNotesMaster && bStarDrawFiller )
-                    ((SdPage*)pPage)->SetAutoLayout( AUTOLAYOUT_NOTES, true );
+                    pPage->SetAutoLayout( AUTOLAYOUT_NOTES, true );
                 if ( nMasterNum )
                 {
                     boost::optional< sal_Int16 > oStartNumbering;
@@ -818,7 +818,7 @@ bool ImplSdPPTImport::Import()
                     }
                 }
                 rStCtrl.Seek( nFPosMerk );
-                ImportPageEffect( (SdPage*)pMPage, bNewAnimationsUsed );
+                ImportPageEffect( pMPage, bNewAnimationsUsed );
 
                 // background object
                 pObj = pMPage->GetObj( 0 );
@@ -941,7 +941,7 @@ bool ImplSdPPTImport::Import()
 
                         aHd.SeekToEndOfRecord( rStCtrl );
                     }
-                    ImportPageEffect( (SdPage*)pPage, bNewAnimationsUsed );
+                    ImportPageEffect( pPage, bNewAnimationsUsed );
                 }
 
                 // creating the corresponding note page
@@ -1012,8 +1012,8 @@ bool ImplSdPPTImport::Import()
             }
             if ( pFoundMaster )
             {
-                static_cast<SdPage*>(pPage)->TRG_SetMasterPage( *((SdPage*)pFoundMaster) );
-                static_cast<SdPage*>(pPage)->SetLayoutName( ((SdPage*)pFoundMaster)->GetLayoutName() );
+                static_cast<SdPage*>(pPage)->TRG_SetMasterPage( *pFoundMaster );
+                static_cast<SdPage*>(pPage)->SetLayoutName( pFoundMaster->GetLayoutName() );
             }
             static_cast<SdPage*>(pPage)->SetAutoLayout( AUTOLAYOUT_TITLE, true, true );
 
@@ -2604,7 +2604,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                                 // interactive object
                                 SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObj, true);
 
-                                ( (ImplSdPPTImport*) this )->FillSdAnimationInfo( pInfo, &aInteractiveInfoAtom, aMacroName );
+                                FillSdAnimationInfo( pInfo, &aInteractiveInfoAtom, aMacroName );
                                 if ( aInteractiveInfoAtom.nAction == 6 ) // Sj -> media action
                                 {
                                     rHdClientData.SeekToContent( rStCtrl );
diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx
index 35e28a1..dc170bf 100644
--- a/sd/source/filter/ppt/pptinanimations.cxx
+++ b/sd/source/filter/ppt/pptinanimations.cxx
@@ -3010,7 +3010,7 @@ sal_Int32 AnimationImporter::importTargetElementContainer( const Atom* pAtom, An
 
                 case 2: // sound
                     {
-                        OUString aSoundURL( ((ImplSdPPTImport*)mpPPTImport)->ReadSound( nRefId ) );
+                        OUString aSoundURL( mpPPTImport->ReadSound( nRefId ) );
                         rTarget <<= aSoundURL;
                         dump( " srcRef=\"%s\"", aSoundURL );
                     }
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 86b2a38..49635c1 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -1224,9 +1224,8 @@ Sequence< Property > ImplIntrospectionAccess::getProperties(sal_Int32 PropertyCo
         nCount += mpStaticImpl->mnMethodPropCount;
 
     // Sequence entsprechend der geforderten Anzahl reallocieren
-    ImplIntrospectionAccess* pThis = (ImplIntrospectionAccess*)this;    // const umgehen
-    pThis->maLastPropertySeq.realloc( nCount );
-    Property* pDestProps = pThis->maLastPropertySeq.getArray();
+    maLastPropertySeq.realloc( nCount );
+    Property* pDestProps = maLastPropertySeq.getArray();
 
     // Alle Properties durchgehen und entsprechend der Concepte uebernehmen
     Sequence<Property> aPropSeq = mpStaticImpl->getProperties();
@@ -1243,7 +1242,7 @@ Sequence< Property > ImplIntrospectionAccess::getProperties(sal_Int32 PropertyCo
     }
 
     // PropertyConcept merken, dies entspricht maLastPropertySeq
-    pThis->mnLastPropertyConcept = PropertyConcepts;
+    mnLastPropertyConcept = PropertyConcepts;
 
     // Zusammengebastelte Sequence liefern
     return maLastPropertySeq;
@@ -1286,8 +1285,6 @@ sal_Bool ImplIntrospectionAccess::hasMethod(const OUString& Name, sal_Int32 Meth
 Sequence< Reference<XIdlMethod> > ImplIntrospectionAccess::getMethods(sal_Int32 MethodConcepts)
     throw( RuntimeException, std::exception )
 {
-    ImplIntrospectionAccess* pThis = (ImplIntrospectionAccess*)this;    // const umgehen
-
     // Wenn alle unterstuetzten Konzepte gefordert werden, Sequence einfach durchreichen
     sal_Int32 nAllSupportedMask =     MethodConcept::DANGEROUS |
                                     PROPERTY |
@@ -1317,8 +1314,8 @@ Sequence< Reference<XIdlMethod> > ImplIntrospectionAccess::getMethods(sal_Int32
     // Anders als bei den Properties kann die Anzahl nicht durch
     // Zaehler in inspect() vorher ermittelt werden, da Methoden
     // mehreren Konzepten angehoeren koennen
-    pThis->maLastMethodSeq.realloc( nLen );
-    Reference<XIdlMethod>* pDestMethods = pThis->maLastMethodSeq.getArray();
+    maLastMethodSeq.realloc( nLen );
+    Reference<XIdlMethod>* pDestMethods = maLastMethodSeq.getArray();
 
     // Alle Methods durchgehen und entsprechend der Concepte uebernehmen
     sal_Int32 iDest = 0;
@@ -1330,10 +1327,10 @@ Sequence< Reference<XIdlMethod> > ImplIntrospectionAccess::getMethods(sal_Int32
     }
 
     // Auf die richtige Laenge bringen
-    pThis->maLastMethodSeq.realloc( iDest );
+    maLastMethodSeq.realloc( iDest );
 
     // MethodConcept merken, dies entspricht maLastMethodSeq
-    pThis->mnLastMethodConcept = MethodConcepts;
+    mnLastMethodConcept = MethodConcepts;
 
     // Zusammengebastelte Sequence liefern
     return maLastMethodSeq;
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 33a3557..733bdb9 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -1588,9 +1588,9 @@ Reference<XEnumeration > ORegistryServiceManager::createContentEnumeration(
     throw(css::uno::RuntimeException, std::exception)
 {
     check_undisposed();
-    MutexGuard aGuard( ((ORegistryServiceManager *)this)->m_mutex );
+    MutexGuard aGuard(m_mutex);
     // get all implementation names registered under this service name from the registry
-    Sequence<OUString> aImpls = ((ORegistryServiceManager *)this)->getFromServiceName( aServiceName );
+    Sequence<OUString> aImpls = getFromServiceName( aServiceName );
     // load and insert all factories specified by the registry
     sal_Int32 i;
     OUString aImplName;
diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx
index 9e89f69..b8ae544 100644
--- a/stoc/test/testintrosp.cxx
+++ b/stoc/test/testintrosp.cxx
@@ -581,7 +581,7 @@ Any ImplIntroTest::getByName( const OUString& aName )
     Any aRetAny;
 
     if( !pNameAccessTab  )
-        ((ImplIntroTest*)this)->pNameAccessTab  = new Reference< XIntroTest >[ DEFAULT_NAME_ACCESS_COUNT ];
+        pNameAccessTab  = new Reference< XIntroTest >[ DEFAULT_NAME_ACCESS_COUNT ];
 
     sal_Int32 iIndex = getIndexForName( aName );
     if( iIndex != -1 )
@@ -634,7 +634,7 @@ Any ImplIntroTest::getByIndex( sal_Int32 Index )
     Any aRetAny;
 
     if( !pIndexAccessTab )
-        ((ImplIntroTest*)this)->pIndexAccessTab = new Reference< XIntroTest >[ iIndexAccessCount ];
+        pIndexAccessTab = new Reference< XIntroTest >[ iIndexAccessCount ];
 
     if( Index < iIndexAccessCount )
     {
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index f978dcd..078ebc9 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -1663,7 +1663,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem( const Rectangle& rRect,
 
             if( pEntry->IsFocused() )
             {
-                Rectangle aRect ( CalcFocusRect( (SvxIconChoiceCtrlEntry*)pEntry ) );
+                Rectangle aRect ( CalcFocusRect( pEntry ) );
                 /*pView->*/ShowFocus( aRect );
                 DrawFocusRect( pOut );
             }
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index ca9266d..2085aaa 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3101,7 +3101,7 @@ bool SwCrsrShell::SelectHiddenRange()
     bool bRet = false;
     if ( !GetViewOptions()->IsShowHiddenChar() && !m_pCurCrsr->HasMark() )
     {
-        SwPosition& rPt = *(SwPosition*)m_pCurCrsr->GetPoint();
+        SwPosition& rPt = *m_pCurCrsr->GetPoint();
         const SwTxtNode* pNode = rPt.nNode.GetNode().GetTxtNode();
         if ( pNode )
         {
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 648c2cd..324a3b3 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -85,7 +85,7 @@ SwTxtFrm *GetAdjFrmAtPos( SwTxtFrm *pFrm, const SwPosition &rPos,
     {
         pFrm = pFrmAtPos;
         pFrm->GetFormatted();
-        pFrmAtPos = (SwTxtFrm*)pFrm->GetFrmAtPos( rPos );
+        pFrmAtPos = pFrm->GetFrmAtPos( rPos );
     }
 
     if( nOffset && bRightMargin )
@@ -148,7 +148,7 @@ SwTxtFrm& SwTxtFrm::GetFrmAtOfst( const sal_Int32 nWhere )
 
 SwTxtFrm *SwTxtFrm::GetFrmAtPos( const SwPosition &rPos )
 {
-    SwTxtFrm *pFoll = (SwTxtFrm*)this;
+    SwTxtFrm *pFoll = this;
     while( pFoll->GetFollow() )
     {
         if( rPos.nContent.GetIndex() > pFoll->GetFollow()->GetOfst() )
@@ -572,7 +572,7 @@ bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
         {
             SwTwips nDiff = rPoint.X() - Frm().Left() - Prt().Left();
             if( nDiff > 50 || nDiff < 0 )
-                ((SwCrsrMoveState*)pCMS)->bPosCorr = true;
+                pCMS->bPosCorr = true;
         }
     }
     else
@@ -597,7 +597,7 @@ bool SwTxtFrm::_GetCrsrOfst(SwPosition* pPos, const Point& rPoint,
         sal_Int32 nOffset = aLine.GetCrsrOfst( pPos, rPoint, bChgFrm, pCMS );
 
         if( pCMS && pCMS->eState == MV_NONE && aLine.GetEnd() == nOffset )
-            ((SwCrsrMoveState*)pCMS)->eState = MV_RIGHTMARGIN;
+            pCMS->eState = MV_RIGHTMARGIN;
 
     // pPos is a pure IN parameter and must not be evaluated.
     // pIter->GetCrsrOfst returns from a nesting with COMPLETE_STRING.
@@ -1041,10 +1041,10 @@ void SwTxtFrm::PrepareVisualMove( sal_Int32& nPos, sal_uInt8& nCrsrLevel,
     if( IsEmpty() || IsHiddenNow() )
         return;
 
-    ((SwTxtFrm*)this)->GetFormatted();
+    GetFormatted();
 
-    SwTxtSizeInfo aInf( (SwTxtFrm*)this );
-    SwTxtCursor  aLine( ((SwTxtFrm*)this), &aInf );
+    SwTxtSizeInfo aInf(this);
+    SwTxtCursor  aLine(this, &aInf);
 
     if( nPos )
         aLine.CharCrsrToLine( nPos );
commit fc5cd8b5e916dcf97ada18ea7e8458bfd820f0b9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 09:39:20 2015 +0100

    redundant check before delete
    
    Change-Id: Ia5a71922fdeed61ef2168c1a297bd9ffc976e9ca

diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index b2ee358..23fa1fc 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -972,8 +972,7 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly)
             SAL_INFO( "sc.filter", "settings export end" );
         }
 
-        if (pSharedData)
-            delete pSharedData;
+        delete pSharedData;
 
         if (xStatusIndicator.is())
             xStatusIndicator->end();
commit 8bfe9c0dfc1133cefd4a204b789d881045abb8b5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 09:31:39 2015 +0100

    cppcheck: invalidPrintfArgType_uint
    
    Change-Id: I5a0b5a4ff60c508f8ea11d613022ee7799900098

diff --git a/rsc/source/rscpp/cpp2.c b/rsc/source/rscpp/cpp2.c
index 45dd492..2c2e550 100644
--- a/rsc/source/rscpp/cpp2.c
+++ b/rsc/source/rscpp/cpp2.c
@@ -270,7 +270,7 @@ int control(int counter)
         break;
 #endif
     case L_error:                       /* BP 5.3.92, #error */
-        fprintf( pCppOut, "cpp: line %u, Error directive: ", line );
+        fprintf( pCppOut, "cpp: line %d, Error directive: ", line );
         while ((c = get()) != '\n' && c != EOF_CHAR)
             cput(c);
         fprintf( pCppOut, "\n" );
commit ed1a89f274861664316beb5372d56ecb0718745f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 29 09:27:25 2015 +0100

    cppcheck: throwInNoexceptFunction
    
    Change-Id: I72572e716e41e739f8d382baa0405af4579a93d2

diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index a7460dd..0043e65 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -132,7 +132,7 @@ public:
                         bool bDoNormalization,
                         bool bNormalizeWhitespace) throw( SAXException );
 
-    sal_uInt32 GetLastColumnCount() const
+    sal_uInt32 GetLastColumnCount() const throw()
         { return (sal_uInt32)(nCurrentPos - nLastLineFeedPos); }
 
     inline void startDocument() throw( SAXException );


More information about the Libreoffice-commits mailing list