Kaydet (Commit) 801b9823 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast: deal with remaining pointer casts

Change-Id: I34315c0e76ee89e456f50776ef3393dc9408e8fd
üst e12fa69f
...@@ -102,7 +102,7 @@ void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport ) ...@@ -102,7 +102,7 @@ void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport )
//!! keep a reference until everything is done to //!! keep a reference until everything is done to
//!! ensure the proper lifetime of the object //!! ensure the proper lifetime of the object
uno::Reference < xml::sax::XDocumentHandler > xFilter( uno::Reference < xml::sax::XDocumentHandler > xFilter(
(xml::sax::XExtendedDocumentHandler *) &rImport, UNO_QUERY ); static_cast<xml::sax::XExtendedDocumentHandler *>(&rImport), UNO_QUERY );
// connect parser and filter // connect parser and filter
xParser->setDocumentHandler( xFilter ); xParser->setDocumentHandler( xFilter );
...@@ -144,7 +144,7 @@ bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType ...@@ -144,7 +144,7 @@ bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType
ConvDicXMLImport *pImport = new ConvDicXMLImport( 0 ); ConvDicXMLImport *pImport = new ConvDicXMLImport( 0 );
//!! keep a first reference to ensure the lifetime of the object !! //!! keep a first reference to ensure the lifetime of the object !!
uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY ); uno::Reference< XInterface > xRef( static_cast<document::XFilter *>(pImport), UNO_QUERY );
ReadThroughDic( rFileURL, *pImport ); // will implicitly add the entries ReadThroughDic( rFileURL, *pImport ); // will implicitly add the entries
bRes = !LinguIsUnspecified( pImport->GetLanguage()) && bRes = !LinguIsUnspecified( pImport->GetLanguage()) &&
...@@ -222,7 +222,7 @@ void ConvDic::Load() ...@@ -222,7 +222,7 @@ void ConvDic::Load()
bNeedEntries = false; bNeedEntries = false;
ConvDicXMLImport *pImport = new ConvDicXMLImport( this ); ConvDicXMLImport *pImport = new ConvDicXMLImport( this );
//!! keep a first reference to ensure the lifetime of the object !! //!! keep a first reference to ensure the lifetime of the object !!
uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY ); uno::Reference< XInterface > xRef( static_cast<document::XFilter *>(pImport), UNO_QUERY );
ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries
bIsModified = false; bIsModified = false;
} }
...@@ -266,7 +266,7 @@ void ConvDic::Save() ...@@ -266,7 +266,7 @@ void ConvDic::Save()
ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler ); ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler );
//!! keep a first(!) reference until everything is done to //!! keep a first(!) reference until everything is done to
//!! ensure the proper lifetime of the object //!! ensure the proper lifetime of the object
uno::Reference< document::XFilter > aRef( (document::XFilter *) pExport ); uno::Reference< document::XFilter > aRef( static_cast<document::XFilter *>(pExport) );
bool bRet = pExport->Export(); // write entries to file bool bRet = pExport->Export(); // write entries to file
DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" );
if (bRet) if (bRet)
......
...@@ -359,7 +359,7 @@ namespace ...@@ -359,7 +359,7 @@ namespace
struct StaticConvDicList : public rtl::StaticWithInit< struct StaticConvDicList : public rtl::StaticWithInit<
uno::Reference<XInterface>, StaticConvDicList> { uno::Reference<XInterface>, StaticConvDicList> {
uno::Reference<XInterface> operator () () { uno::Reference<XInterface> operator () () {
return (cppu::OWeakObject *) new ConvDicList; return static_cast<cppu::OWeakObject *>(new ConvDicList);
} }
}; };
} }
...@@ -565,7 +565,7 @@ void SAL_CALL ConvDicList::dispose( ) ...@@ -565,7 +565,7 @@ void SAL_CALL ConvDicList::dispose( )
if (!bDisposing) if (!bDisposing)
{ {
bDisposing = true; bDisposing = true;
EventObject aEvtObj( (XConversionDictionaryList *) this ); EventObject aEvtObj( static_cast<XConversionDictionaryList *>(this) );
aEvtListeners.disposeAndClear( aEvtObj ); aEvtListeners.disposeAndClear( aEvtObj );
FlushDics(); FlushDics();
......
...@@ -95,7 +95,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, bool &bNeg ) ...@@ -95,7 +95,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, bool &bNeg )
sal_Size nSniffPos = rpStream->Tell(); sal_Size nSniffPos = rpStream->Tell();
static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 )); static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 ));
pMagicHeader[ nVerOOo7Len ] = '\0'; pMagicHeader[ nVerOOo7Len ] = '\0';
if ((rpStream->Read((void *) pMagicHeader, nVerOOo7Len) == nVerOOo7Len) && if ((rpStream->Read(static_cast<void *>(pMagicHeader), nVerOOo7Len) == nVerOOo7Len) &&
!strcmp(pMagicHeader, pVerOOo7)) !strcmp(pMagicHeader, pVerOOo7))
{ {
bool bSuccess; bool bSuccess;
......
...@@ -387,7 +387,7 @@ uno::Reference< XInterface > SAL_CALL ...@@ -387,7 +387,7 @@ uno::Reference< XInterface > SAL_CALL
DicList_CreateInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ ) DicList_CreateInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ )
throw(Exception) throw(Exception)
{ {
uno::Reference< XInterface > xService = (cppu::OWeakObject *) new DicList; uno::Reference< XInterface > xService = static_cast<cppu::OWeakObject *>(new DicList);
return xService; return xService;
} }
...@@ -580,7 +580,7 @@ void SAL_CALL ...@@ -580,7 +580,7 @@ void SAL_CALL
if (!bDisposing) if (!bDisposing)
{ {
bDisposing = true; bDisposing = true;
EventObject aEvtObj( (XDictionaryList *) this ); EventObject aEvtObj( static_cast<XDictionaryList *>(this) );
aEvtListeners.disposeAndClear( aEvtObj ); aEvtListeners.disposeAndClear( aEvtObj );
if (pDicEvtLstnrHelper) if (pDicEvtLstnrHelper)
......
...@@ -920,7 +920,7 @@ throw (uno::RuntimeException, std::exception) ...@@ -920,7 +920,7 @@ throw (uno::RuntimeException, std::exception)
void SAL_CALL GrammarCheckingIterator::dispose() void SAL_CALL GrammarCheckingIterator::dispose()
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
lang::EventObject aEvt( (linguistic2::XProofreadingIterator *) this ); lang::EventObject aEvt( static_cast<linguistic2::XProofreadingIterator *>(this) );
m_aEventListeners.disposeAndClear( aEvt ); m_aEventListeners.disposeAndClear( aEvt );
TerminateThread(); TerminateThread();
......
...@@ -218,7 +218,7 @@ Reference< XInterface > SAL_CALL LinguProps_CreateInstance( ...@@ -218,7 +218,7 @@ Reference< XInterface > SAL_CALL LinguProps_CreateInstance(
const Reference< XMultiServiceFactory > & /*rSMgr*/ ) const Reference< XMultiServiceFactory > & /*rSMgr*/ )
throw(Exception) throw(Exception)
{ {
Reference< XInterface > xService = (cppu::OWeakObject*)new LinguProps; Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new LinguProps);
return xService; return xService;
} }
...@@ -245,7 +245,7 @@ void SAL_CALL LinguProps::setPropertyValue( ...@@ -245,7 +245,7 @@ void SAL_CALL LinguProps::setPropertyValue(
Any aOld( aConfig.GetProperty( pCur->nWID ) ); Any aOld( aConfig.GetProperty( pCur->nWID ) );
if (aOld != rValue && aConfig.SetProperty( pCur->nWID, rValue )) if (aOld != rValue && aConfig.SetProperty( pCur->nWID, rValue ))
{ {
PropertyChangeEvent aChgEvt( (XPropertySet *) this, rPropertyName, PropertyChangeEvent aChgEvt( static_cast<XPropertySet *>(this), rPropertyName,
sal_False, pCur->nWID, aOld, rValue ); sal_False, pCur->nWID, aOld, rValue );
launchEvent( aChgEvt ); launchEvent( aChgEvt );
} }
...@@ -322,7 +322,7 @@ void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rV ...@@ -322,7 +322,7 @@ void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rV
Any aOld( aConfig.GetProperty( nHandle ) ); Any aOld( aConfig.GetProperty( nHandle ) );
if (aOld != rValue && aConfig.SetProperty( nHandle, rValue )) if (aOld != rValue && aConfig.SetProperty( nHandle, rValue ))
{ {
PropertyChangeEvent aChgEvt( (XPropertySet *) this, PropertyChangeEvent aChgEvt( static_cast<XPropertySet *>(this),
LinguOptions::GetName( nHandle ), sal_False, nHandle, aOld, rValue ); LinguOptions::GetName( nHandle ), sal_False, nHandle, aOld, rValue );
launchEvent( aChgEvt ); launchEvent( aChgEvt );
} }
...@@ -393,7 +393,7 @@ void SAL_CALL ...@@ -393,7 +393,7 @@ void SAL_CALL
// (see AppExitListener for saving) // (see AppExitListener for saving)
//aOpt.Save(); // save (possible) changes before exiting //aOpt.Save(); // save (possible) changes before exiting
EventObject aEvtObj( (XPropertySet *) this ); EventObject aEvtObj( static_cast<XPropertySet *>(this) );
aEvtListeners.disposeAndClear( aEvtObj ); aEvtListeners.disposeAndClear( aEvtObj );
aPropListeners.disposeAndClear( aEvtObj ); aPropListeners.disposeAndClear( aEvtObj );
} }
......
...@@ -237,7 +237,7 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( ...@@ -237,7 +237,7 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper(
if (xDicList.is()) if (xDicList.is())
{ {
xDicList->addDictionaryListEventListener( xDicList->addDictionaryListEventListener(
(linguistic2::XDictionaryListEventListener *) this, sal_False ); static_cast<linguistic2::XDictionaryListEventListener *>(this), sal_False );
} }
nCombinedLngSvcEvt = 0; nCombinedLngSvcEvt = 0;
...@@ -409,7 +409,7 @@ void LngSvcMgrListenerHelper::DisposeAndClear( const lang::EventObject &rEvtObj ...@@ -409,7 +409,7 @@ void LngSvcMgrListenerHelper::DisposeAndClear( const lang::EventObject &rEvtObj
if (xDicList.is()) if (xDicList.is())
{ {
xDicList->removeDictionaryListEventListener( xDicList->removeDictionaryListEventListener(
(linguistic2::XDictionaryListEventListener *) this ); static_cast<linguistic2::XDictionaryListEventListener *>(this) );
xDicList = 0; xDicList = 0;
} }
} }
...@@ -423,7 +423,7 @@ bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster( ...@@ -423,7 +423,7 @@ bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster(
{ {
aLngSvcEvtBroadcasters.addInterface( rxBroadcaster ); aLngSvcEvtBroadcasters.addInterface( rxBroadcaster );
rxBroadcaster->addLinguServiceEventListener( rxBroadcaster->addLinguServiceEventListener(
(linguistic2::XLinguServiceEventListener *) this ); static_cast<linguistic2::XLinguServiceEventListener *>(this) );
} }
return bRes; return bRes;
} }
...@@ -437,7 +437,7 @@ bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster( ...@@ -437,7 +437,7 @@ bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster(
{ {
aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster ); aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster );
rxBroadcaster->removeLinguServiceEventListener( rxBroadcaster->removeLinguServiceEventListener(
(linguistic2::XLinguServiceEventListener *) this ); static_cast<linguistic2::XLinguServiceEventListener *>(this) );
} }
return bRes; return bRes;
} }
...@@ -985,7 +985,7 @@ void LngSvcMgr::GetListenerHelper_Impl() ...@@ -985,7 +985,7 @@ void LngSvcMgr::GetListenerHelper_Impl()
if (!pListenerHelper) if (!pListenerHelper)
{ {
pListenerHelper = new LngSvcMgrListenerHelper( *this, linguistic::GetDictionaryList() ); pListenerHelper = new LngSvcMgrListenerHelper( *this, linguistic::GetDictionaryList() );
xListenerHelper = (linguistic2::XLinguServiceEventListener *) pListenerHelper; xListenerHelper = static_cast<linguistic2::XLinguServiceEventListener *>(pListenerHelper);
} }
} }
...@@ -2094,7 +2094,7 @@ uno::Reference< uno::XInterface > SAL_CALL LngSvcMgr_CreateInstance( ...@@ -2094,7 +2094,7 @@ uno::Reference< uno::XInterface > SAL_CALL LngSvcMgr_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ ) const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ )
throw(uno::Exception) throw(uno::Exception)
{ {
uno::Reference< uno::XInterface > xService = (cppu::OWeakObject*) new LngSvcMgr; uno::Reference< uno::XInterface > xService = static_cast<cppu::OWeakObject*>(new LngSvcMgr);
return xService; return xService;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment