From 5f6f57c26ee15787ca2f775f853e57cfc11d666f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 21 Oct 2014 15:35:58 +0200 Subject: loplugin: cstylecast Change-Id: Id4c581724e7e5466ffe46f11f0a8da2527c23dc6 --- lotuswordpro/source/filter/bencont.cxx | 6 +++--- lotuswordpro/source/filter/benlist.cxx | 4 ++-- lotuswordpro/source/filter/benobj.cxx | 2 +- lotuswordpro/source/filter/bento.hxx | 2 +- lotuswordpro/source/filter/lwpfootnote.cxx | 4 ++-- lotuswordpro/source/filter/lwplayout.cxx | 2 +- lotuswordpro/source/filter/lwppagelayout.cxx | 6 +++--- lotuswordpro/source/filter/lwptablelayout.cxx | 18 +++++++++--------- lotuswordpro/source/filter/lwptblcell.cxx | 2 +- lotuswordpro/source/filter/lwptblcell.hxx | 2 +- lotuswordpro/source/filter/lwptblformula.cxx | 6 +++--- lotuswordpro/source/filter/tocread.cxx | 4 ++-- lotuswordpro/source/filter/xfilter/xfframe.cxx | 4 ++-- lotuswordpro/source/filter/xfilter/xfliststyle.cxx | 10 +++++----- lotuswordpro/source/filter/xfilter/xfparastyle.cxx | 2 +- lotuswordpro/source/filter/xfilter/xfstylecont.cxx | 4 ++-- 16 files changed, 39 insertions(+), 39 deletions(-) (limited to 'lotuswordpro/source/filter') diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx index 340b7cc49ddd..8ed9df160237 100644 --- a/lotuswordpro/source/filter/bencont.cxx +++ b/lotuswordpro/source/filter/bencont.cxx @@ -125,7 +125,7 @@ LtcBenContainer::RegisterPropertyName(const char * sPropertyName, { if (! pNamedObject->IsPropertyName()) return BenErr_NameConflict; - else *ppPropertyName = (pCBenPropertyName) pNamedObject; + else *ppPropertyName = static_cast(pNamedObject); } else { @@ -134,7 +134,7 @@ LtcBenContainer::RegisterPropertyName(const char * sPropertyName, return BenErr_DuplicateObjectID; *ppPropertyName = new CBenPropertyName(this, cNextAvailObjectID, - (pCBenObject) pPrevObject, sPropertyName, pPrevNamedObjectListElmt); + static_cast(pPrevObject), sPropertyName, pPrevNamedObjectListElmt); ++cNextAvailObjectID; } @@ -144,7 +144,7 @@ LtcBenContainer::RegisterPropertyName(const char * sPropertyName, pCBenObject LtcBenContainer::GetNextObject(pCBenObject pCurrObject) { - return (pCBenObject) cObjects.GetNextOrNULL(pCurrObject); + return static_cast(cObjects.GetNextOrNULL(pCurrObject)); } pCBenObject diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx index 2e3fcd1772b1..17acf1971be6 100644 --- a/lotuswordpro/source/filter/benlist.cxx +++ b/lotuswordpro/source/filter/benlist.cxx @@ -66,7 +66,7 @@ FindNamedObject(pCUtList pList, const char * sName, pCurr = pCurr->GetPrev()) { pCBenNamedObjectListElmt pCurrNamedObjectListElmt = - (pCBenNamedObjectListElmt) pCurr; + static_cast(pCurr); int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()-> GetNameCStr()); @@ -96,7 +96,7 @@ FindID(pCUtList pList, BenObjectID ObjectID, pCUtListElmt * ppPrev) for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating; pCurr = pCurr->GetPrev()) { - pCBenIDListElmt pCurrIDListElmt = (pCBenIDListElmt) pCurr; + pCBenIDListElmt pCurrIDListElmt = static_cast(pCurr); if (ObjectID == pCurrIDListElmt->GetID()) return pCurrIDListElmt; diff --git a/lotuswordpro/source/filter/benobj.cxx b/lotuswordpro/source/filter/benobj.cxx index 500fe737de42..3bba37acf011 100644 --- a/lotuswordpro/source/filter/benobj.cxx +++ b/lotuswordpro/source/filter/benobj.cxx @@ -67,7 +67,7 @@ pCBenProperty CBenObject::UseProperty(BenObjectID PropertyID) { pCUtListElmt pPrev; - return (pCBenProperty) FindID(&cProperties, PropertyID, &pPrev); + return static_cast( FindID(&cProperties, PropertyID, &pPrev) ); } pCBenValue diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx index ec6abfea4e2a..0a44cf3cfeab 100644 --- a/lotuswordpro/source/filter/bento.hxx +++ b/lotuswordpro/source/filter/bento.hxx @@ -388,7 +388,7 @@ private: // Data inline pCBenValueSegment CBenValue::GetNextValueSegment(pCBenValueSegment pCurrValueSegment) -{ return (pCBenValueSegment) cValueSegments.GetNextOrNULL(pCurrValueSegment); } +{ return static_cast( cValueSegments.GetNextOrNULL(pCurrValueSegment) ); } inline pLtcBenContainer CBenValue::GetContainer() { return GetProperty()->GetContainer(); } diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx index 19467ef830f1..5c64d00ba1a1 100644 --- a/lotuswordpro/source/filter/lwpfootnote.cxx +++ b/lotuswordpro/source/filter/lwpfootnote.cxx @@ -375,8 +375,8 @@ LwpEnSuperTableLayout* LwpFootnote::FindFootnoteTableLayout() pContent->IsActive() && pContent->GetLayout(NULL)) { // Found it! - return (LwpEnSuperTableLayout *) - ((LwpTable*)pContent)->GetSuperTableLayout(); + return static_cast( + static_cast(pContent)->GetSuperTableLayout()); } return NULL; diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 2aa4dc765ba2..b452ff8f9f14 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -923,7 +923,7 @@ LwpTabOverride* LwpMiddleLayout::GetTabOverride() if(!m_TabPiece.IsNull()) { LwpTabPiece *pPiece = dynamic_cast(m_TabPiece.obj().get()); - return (LwpTabOverride*)(pPiece ? pPiece->GetOverride() : NULL); + return static_cast(pPiece ? pPiece->GetOverride() : NULL); } return NULL; } diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx index 915621c2f129..865e4d43eefb 100644 --- a/lotuswordpro/source/filter/lwppagelayout.cxx +++ b/lotuswordpro/source/filter/lwppagelayout.cxx @@ -338,14 +338,14 @@ void LwpPageLayout::RegisterStyle() //Add the page master to stylemanager XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - m_pXFPageMaster = pm1 = (XFPageMaster*)pXFStyleManager->AddStyle(pm1); + m_pXFPageMaster = pm1 = static_cast(pXFStyleManager->AddStyle(pm1)); OUString pmname = pm1->GetStyleName(); //Add master page XFMasterPage* mp1 = new XFMasterPage(); mp1->SetStyleName(GetName().str()); mp1->SetPageMaster(pmname); - mp1 = (XFMasterPage*)pXFStyleManager->AddStyle(mp1); + mp1 = static_cast(pXFStyleManager->AddStyle(mp1)); m_StyleName = mp1->GetStyleName(); //Set footer style @@ -397,7 +397,7 @@ OUString LwpPageLayout::RegisterEndnoteStyle() //Add the page master to stylemanager XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - m_pXFPageMaster = pm1 = (XFPageMaster*)pXFStyleManager->AddStyle(pm1); + m_pXFPageMaster = pm1 = static_cast(pXFStyleManager->AddStyle(pm1)); OUString pmname = pm1->GetStyleName(); //Add master page diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 0605ab3096bf..d3e037abbf21 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -1108,9 +1108,9 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) try{ - LwpDLVListHeadHolder* pHolder = (LwpDLVListHeadHolder*)pFoundry->GetNumberManager().GetTableRangeID().obj().get(); + LwpDLVListHeadHolder* pHolder = static_cast(pFoundry->GetNumberManager().GetTableRangeID().obj().get()); - LwpTableRange* pTableRange = (LwpTableRange*)pHolder->GetHeadID().obj().get(); + LwpTableRange* pTableRange = static_cast(pHolder->GetHeadID().obj().get()); //Look up the table while (NULL!=pTableRange) @@ -1125,17 +1125,17 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) if (pTableRange) { - LwpCellRange* pRange = (LwpCellRange*)pTableRange->GetCellRangeID().obj().get(); - LwpFolder* pFolder = (LwpFolder*)pRange->GetFolderID().obj().get(); + LwpCellRange* pRange = static_cast(pTableRange->GetCellRangeID().obj().get()); + LwpFolder* pFolder = static_cast(pRange->GetFolderID().obj().get()); LwpObjectID aRowListID = pFolder->GetChildHeadID(); - LwpRowList* pRowList = (LwpRowList*)aRowListID.obj().get(); + LwpRowList* pRowList = static_cast(aRowListID.obj().get()); //loop the rowlist while( NULL!=pRowList) { sal_uInt16 nRowID = pRowList->GetRowID(); { - LwpCellList* pCellList = (LwpCellList*)pRowList->GetChildHeadID().obj().get(); + LwpCellList* pCellList = static_cast(pRowList->GetChildHeadID().obj().get()); //loop the celllist while( NULL!=pCellList) { @@ -1156,10 +1156,10 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID) assert(false); } } - pCellList = (LwpCellList*)pCellList->GetNextID().obj().get(); + pCellList = static_cast(pCellList->GetNextID().obj().get()); } } - pRowList =(LwpRowList*)pRowList->GetNextID().obj().get(); + pRowList = static_cast(pRowList->GetNextID().obj().get()); } } @@ -1195,7 +1195,7 @@ void LwpTableLayout::PostProcessParagraph(XFCell *pCell, sal_uInt16 nRowID, sal_ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); if (!sNumfmt.isEmpty()) { - pNumStyle = (XFNumberStyle*)pXFStyleManager->FindStyle( sNumfmt); + pNumStyle = static_cast(pXFStyleManager->FindStyle( sNumfmt)); XFColor aColor = pNumStyle->GetColor(); if ( aColor != aNullColor ) bColorMod = true;//end diff --git a/lotuswordpro/source/filter/lwptblcell.cxx b/lotuswordpro/source/filter/lwptblcell.cxx index 070bb034aa09..cf0cddc8bafd 100644 --- a/lotuswordpro/source/filter/lwptblcell.cxx +++ b/lotuswordpro/source/filter/lwptblcell.cxx @@ -107,7 +107,7 @@ void LwpCellList::Parse(IXFStream* /*pOutputStream*/) void LwpCellList::Convert(XFCell * pCell, LwpTableLayout* /*pCellsMap*/) { LwpObjectID aValueID = GetValueID(); - LwpNumericValue* pValue = (LwpNumericValue*)aValueID.obj().get(); + LwpNumericValue* pValue = static_cast(aValueID.obj().get()); if (pValue) { pCell->SetValue( pValue->GetValue() ); diff --git a/lotuswordpro/source/filter/lwptblcell.hxx b/lotuswordpro/source/filter/lwptblcell.hxx index 1d610248d271..1bbe0614e346 100644 --- a/lotuswordpro/source/filter/lwptblcell.hxx +++ b/lotuswordpro/source/filter/lwptblcell.hxx @@ -152,7 +152,7 @@ public: void Parse(IXFStream* pOutputStream) SAL_OVERRIDE; LwpObjectID GetCellRangeID(){return cpCellRange;} LwpObjectID GetTableID(){ return cqTable;} - LwpTableRange* GetNext() { return (LwpTableRange*)(LwpDLVList::GetNext().obj().get());} + LwpTableRange* GetNext() { return static_cast(LwpDLVList::GetNext().obj().get());} protected: LwpObjectID cqTable; LwpObjectID cpCellRange; diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx index 9623ef168d42..4f6bca048031 100644 --- a/lotuswordpro/source/filter/lwptblformula.cxx +++ b/lotuswordpro/source/filter/lwptblformula.cxx @@ -167,12 +167,12 @@ bool LwpFormulaInfo::ReadCellRange() bool readSucceeded = true; if (!ReadCellID( )) // start readSucceeded = false; - LwpFormulaCellAddr* pStartCellAddr = (LwpFormulaCellAddr*)m_aStack.back(); + LwpFormulaCellAddr* pStartCellAddr = static_cast(m_aStack.back()); m_aStack.pop_back(); if (!ReadCellID()) // end readSucceeded = false; - LwpFormulaCellAddr* pEndCellAddr = (LwpFormulaCellAddr*)m_aStack.back(); + LwpFormulaCellAddr* pEndCellAddr = static_cast(m_aStack.back()); m_aStack.pop_back(); m_aStack.push_back( new LwpFormulaCellRangeAddr(pStartCellAddr->GetCol(), @@ -368,7 +368,7 @@ void LwpFormulaInfo::Read() { LwpCellList::Read(); { - LwpRowList* pRowList =(LwpRowList*)cParent.obj().get(); + LwpRowList* pRowList = static_cast(cParent.obj().get()); if (pRowList) { m_nFormulaRow = pRowList->GetRowID(); diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx index 77dbdb166bc0..bab300661f1c 100644 --- a/lotuswordpro/source/filter/tocread.cxx +++ b/lotuswordpro/source/filter/tocread.cxx @@ -295,8 +295,8 @@ CBenTOCReader::ReadTOC() return BenErr_DuplicateName; } - pCBenObject pPrevObject = (pCBenObject) cpContainer-> - GetObjects().GetLast(); + pCBenObject pPrevObject = static_cast( cpContainer-> + GetObjects().GetLast()); if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME) pObject = new CBenPropertyName(cpContainer, ObjectID, diff --git a/lotuswordpro/source/filter/xfilter/xfframe.cxx b/lotuswordpro/source/filter/xfilter/xfframe.cxx index 6cb2dde102fc..3eee43d15040 100644 --- a/lotuswordpro/source/filter/xfilter/xfframe.cxx +++ b/lotuswordpro/source/filter/xfilter/xfframe.cxx @@ -97,7 +97,7 @@ void XFFrame::Add(XFContent *pContent) XFContentContainer::Add(pContent); if( pContent->GetContentType() == enumXFContentFrame ) { - XFFrame *pFrame = (XFFrame*)pContent; + XFFrame *pFrame = static_cast(pContent); if( pFrame ) { pFrame->SetZIndex(pFrame->m_nZIndex + 1); @@ -199,7 +199,7 @@ void XFFrame::AdjustZIndex() { if( pContent->GetContentType() == enumXFContentFrame ) { - XFFrame *pFrame = (XFFrame*)pContent.get(); + XFFrame *pFrame = static_cast(pContent.get()); pFrame->m_nZIndex = m_nZIndex + 1; pFrame->AdjustZIndex(); } diff --git a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx index 7f7050aff846..14d28b2de066 100644 --- a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx @@ -163,7 +163,7 @@ XFListStyle::XFListStyle() m_pListLevels[i]->SetMinLabelWidth(0.499); m_pListLevels[i]->SetIndent(0.501*(i+1)); m_pListLevels[i]->SetLevel(i+1); - ( (XFListlevelNumber*)m_pListLevels[i])->SetNumFmt(nf); + static_cast(m_pListLevels[i])->SetNumFmt(nf); } } @@ -175,12 +175,12 @@ XFListStyle::XFListStyle(const XFListStyle& other):XFStyle(other) type = other.m_pListLevels[i]->m_eListType; if( type == enumXFListLevelNumber ) { - XFListlevelNumber *pNum = (XFListlevelNumber*)other.m_pListLevels[i]; + XFListlevelNumber *pNum = static_cast(other.m_pListLevels[i]); m_pListLevels[i] = new XFListlevelNumber(*pNum); } else if( type == enumXFListLevelBullet ) { - XFListLevelBullet *pBullet = (XFListLevelBullet*)other.m_pListLevels[i]; + XFListLevelBullet *pBullet = static_cast(other.m_pListLevels[i]); m_pListLevels[i] = new XFListLevelBullet(*pBullet); } else @@ -196,12 +196,12 @@ XFListStyle& XFListStyle::operator=(const XFListStyle& other) type = other.m_pListLevels[i]->m_eListType; if( type == enumXFListLevelNumber ) { - XFListlevelNumber *pNum = (XFListlevelNumber*)m_pListLevels[i]; + XFListlevelNumber *pNum = static_cast(m_pListLevels[i]); m_pListLevels[i] = new XFListlevelNumber(*pNum); } else if( type == enumXFListLevelBullet ) { - XFListLevelBullet *pBullet = (XFListLevelBullet*)m_pListLevels[i]; + XFListLevelBullet *pBullet = static_cast(m_pListLevels[i]); m_pListLevels[i] = new XFListLevelBullet(*pBullet); } else diff --git a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx index 1b73242b4390..8364d1ae5c8b 100644 --- a/lotuswordpro/source/filter/xfilter/xfparastyle.cxx +++ b/lotuswordpro/source/filter/xfilter/xfparastyle.cxx @@ -305,7 +305,7 @@ bool XFParaStyle::Equal(IXFStyle *pStyle) if( !pStyle || pStyle->GetStyleFamily() != enumXFStylePara ) return false; - XFParaStyle *pOther = (XFParaStyle*)(pStyle); + XFParaStyle *pOther = static_cast(pStyle); if( m_nFlag != pOther->m_nFlag ) return false; diff --git a/lotuswordpro/source/filter/xfilter/xfstylecont.cxx b/lotuswordpro/source/filter/xfilter/xfstylecont.cxx index d390ed60577d..517d15b59036 100644 --- a/lotuswordpro/source/filter/xfilter/xfstylecont.cxx +++ b/lotuswordpro/source/filter/xfilter/xfstylecont.cxx @@ -217,7 +217,7 @@ void XFStyleContainer::ManageStyleFont(IXFStyle *pStyle) if( pStyle->GetStyleFamily() == enumXFStyleText ) { - XFTextStyle *pTS = (XFTextStyle*)pStyle; + XFTextStyle *pTS = static_cast(pStyle); pStyleFont = pTS->GetFont(); if( !pStyleFont.is() ) return; @@ -236,7 +236,7 @@ void XFStyleContainer::ManageStyleFont(IXFStyle *pStyle) } else if( pStyle->GetStyleFamily() == enumXFStylePara ) { - XFParaStyle *pPS = (XFParaStyle*)pStyle; + XFParaStyle *pPS = static_cast(pStyle); pStyleFont = pPS->GetFont(); if( !pStyleFont.is() ) return; -- cgit