loplugin:cstylecast: deal with remaining pointer casts

Change-Id: Ife37243f051e23ebdd5d8d8692b59a748d491a26
This commit is contained in:
Stephan Bergmann
2015-06-08 16:28:06 +02:00
parent 54bac4ddaf
commit eac0f3023c
4 changed files with 7 additions and 7 deletions

View File

@@ -155,7 +155,7 @@ void SmGraphicAccessible::LaunchEvent(
const uno::Any &rNewVal) const uno::Any &rNewVal)
{ {
AccessibleEventObject aEvt; AccessibleEventObject aEvt;
aEvt.Source = (XAccessible *) this; aEvt.Source = static_cast<XAccessible *>(this);
aEvt.EventId = nAccesibleEventId; aEvt.EventId = nAccesibleEventId;
aEvt.OldValue = rOldVal; aEvt.OldValue = rOldVal;
aEvt.NewValue = rNewVal ; aEvt.NewValue = rNewVal ;

View File

@@ -2363,7 +2363,7 @@ void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyl
while( NULL != (pSubset = pSubsetMap->GetNextSubset( bFirst )) ) while( NULL != (pSubset = pSubsetMap->GetNextSubset( bFirst )) )
{ {
sal_uInt16 nPos = pFontsSubsetLB->InsertEntry( pSubset->GetName()); sal_uInt16 nPos = pFontsSubsetLB->InsertEntry( pSubset->GetName());
pFontsSubsetLB->SetEntryData( nPos, (void *) pSubset ); pFontsSubsetLB->SetEntryData( nPos, const_cast<Subset *>(pSubset) );
// subset must live at least as long as the selected font !!! // subset must live at least as long as the selected font !!!
if( bFirst ) if( bFirst )
pFontsSubsetLB->SelectEntryPos( nPos ); pFontsSubsetLB->SelectEntryPos( nPos );

View File

@@ -292,7 +292,7 @@ sal_uLong SmXMLImportWrapper::ReadThroughComponent(
{ {
// sax parser sends wrapped exceptions, // sax parser sends wrapped exceptions,
// try to find the original one // try to find the original one
xml::sax::SAXException aSaxEx = *(xml::sax::SAXException*)(&r); xml::sax::SAXException aSaxEx = *static_cast<xml::sax::SAXException*>(&r);
bool bTryChild = true; bool bTryChild = true;
while( bTryChild ) while( bTryChild )
@@ -428,7 +428,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLImport_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr) const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception ) throw( uno::Exception )
{ {
return (cppu::OWeakObject*)new SmXMLImport(comphelper::getComponentContext(rSMgr), SmXMLImport_getImplementationName(), SvXMLImportFlags::ALL); return static_cast<cppu::OWeakObject*>(new SmXMLImport(comphelper::getComponentContext(rSMgr), SmXMLImport_getImplementationName(), SvXMLImportFlags::ALL));
} }
@@ -448,7 +448,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLImportMeta_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr) const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception ) throw( uno::Exception )
{ {
return (cppu::OWeakObject*)new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportMeta_getImplementationName(), SvXMLImportFlags::META ); return static_cast<cppu::OWeakObject*>(new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportMeta_getImplementationName(), SvXMLImportFlags::META ));
} }
@@ -468,7 +468,7 @@ uno::Reference< uno::XInterface > SAL_CALL SmXMLImportSettings_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr) const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception ) throw( uno::Exception )
{ {
return (cppu::OWeakObject*)new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportSettings_getImplementationName(), SvXMLImportFlags::SETTINGS ); return static_cast<cppu::OWeakObject*>(new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportSettings_getImplementationName(), SvXMLImportFlags::SETTINGS ));
} }
sal_Int64 SAL_CALL SmXMLImport::getSomething( sal_Int64 SAL_CALL SmXMLImport::getSomething(

View File

@@ -181,7 +181,7 @@ SmFontPickListBox& SmFontPickListBox::operator=(const SmFontPickList& rList)
{ {
sal_uInt16 nPos; sal_uInt16 nPos;
*(SmFontPickList *)this = rList; *static_cast<SmFontPickList *>(this) = rList;
for (nPos = 0; nPos < aFontVec.size(); nPos++) for (nPos = 0; nPos < aFontVec.size(); nPos++)
InsertEntry(GetStringItem(aFontVec[nPos]), nPos); InsertEntry(GetStringItem(aFontVec[nPos]), nPos);