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 )
//!! keep a reference until everything is done to
//!! ensure the proper lifetime of the object
uno::Reference < xml::sax::XDocumentHandler > xFilter(
(xml::sax::XExtendedDocumentHandler *) &rImport, UNO_QUERY );
static_cast<xml::sax::XExtendedDocumentHandler *>(&rImport), UNO_QUERY );
// connect parser and filter
xParser->setDocumentHandler( xFilter );
......@@ -144,7 +144,7 @@ bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType
ConvDicXMLImport *pImport = new ConvDicXMLImport( 0 );
//!! 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
bRes = !LinguIsUnspecified( pImport->GetLanguage()) &&
......@@ -222,7 +222,7 @@ void ConvDic::Load()
bNeedEntries = false;
ConvDicXMLImport *pImport = new ConvDicXMLImport( this );
//!! 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
bIsModified = false;
}
......@@ -266,7 +266,7 @@ void ConvDic::Save()
ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler );
//!! keep a first(!) reference until everything is done to
//!! 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
DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" );
if (bRet)
......
......@@ -359,7 +359,7 @@ namespace
struct StaticConvDicList : public rtl::StaticWithInit<
uno::Reference<XInterface>, StaticConvDicList> {
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( )
if (!bDisposing)
{
bDisposing = true;
EventObject aEvtObj( (XConversionDictionaryList *) this );
EventObject aEvtObj( static_cast<XConversionDictionaryList *>(this) );
aEvtListeners.disposeAndClear( aEvtObj );
FlushDics();
......
......@@ -95,7 +95,7 @@ sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, bool &bNeg )
sal_Size nSniffPos = rpStream->Tell();
static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 ));
pMagicHeader[ nVerOOo7Len ] = '\0';
if ((rpStream->Read((void *) pMagicHeader, nVerOOo7Len) == nVerOOo7Len) &&
if ((rpStream->Read(static_cast<void *>(pMagicHeader), nVerOOo7Len) == nVerOOo7Len) &&
!strcmp(pMagicHeader, pVerOOo7))
{
bool bSuccess;
......
......@@ -387,7 +387,7 @@ uno::Reference< XInterface > SAL_CALL
DicList_CreateInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ )
throw(Exception)
{
uno::Reference< XInterface > xService = (cppu::OWeakObject *) new DicList;
uno::Reference< XInterface > xService = static_cast<cppu::OWeakObject *>(new DicList);
return xService;
}
......@@ -580,7 +580,7 @@ void SAL_CALL
if (!bDisposing)
{
bDisposing = true;
EventObject aEvtObj( (XDictionaryList *) this );
EventObject aEvtObj( static_cast<XDictionaryList *>(this) );
aEvtListeners.disposeAndClear( aEvtObj );
if (pDicEvtLstnrHelper)
......
......@@ -920,7 +920,7 @@ throw (uno::RuntimeException, std::exception)
void SAL_CALL GrammarCheckingIterator::dispose()
throw (uno::RuntimeException, std::exception)
{
lang::EventObject aEvt( (linguistic2::XProofreadingIterator *) this );
lang::EventObject aEvt( static_cast<linguistic2::XProofreadingIterator *>(this) );
m_aEventListeners.disposeAndClear( aEvt );
TerminateThread();
......
......@@ -218,7 +218,7 @@ Reference< XInterface > SAL_CALL LinguProps_CreateInstance(
const Reference< XMultiServiceFactory > & /*rSMgr*/ )
throw(Exception)
{
Reference< XInterface > xService = (cppu::OWeakObject*)new LinguProps;
Reference< XInterface > xService = static_cast<cppu::OWeakObject*>(new LinguProps);
return xService;
}
......@@ -245,7 +245,7 @@ void SAL_CALL LinguProps::setPropertyValue(
Any aOld( aConfig.GetProperty( pCur->nWID ) );
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 );
launchEvent( aChgEvt );
}
......@@ -322,7 +322,7 @@ void SAL_CALL LinguProps::setFastPropertyValue( sal_Int32 nHandle, const Any& rV
Any aOld( aConfig.GetProperty( nHandle ) );
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 );
launchEvent( aChgEvt );
}
......@@ -393,7 +393,7 @@ void SAL_CALL
// (see AppExitListener for saving)
//aOpt.Save(); // save (possible) changes before exiting
EventObject aEvtObj( (XPropertySet *) this );
EventObject aEvtObj( static_cast<XPropertySet *>(this) );
aEvtListeners.disposeAndClear( aEvtObj );
aPropListeners.disposeAndClear( aEvtObj );
}
......
......@@ -237,7 +237,7 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper(
if (xDicList.is())
{
xDicList->addDictionaryListEventListener(
(linguistic2::XDictionaryListEventListener *) this, sal_False );
static_cast<linguistic2::XDictionaryListEventListener *>(this), sal_False );
}
nCombinedLngSvcEvt = 0;
......@@ -409,7 +409,7 @@ void LngSvcMgrListenerHelper::DisposeAndClear( const lang::EventObject &rEvtObj
if (xDicList.is())
{
xDicList->removeDictionaryListEventListener(
(linguistic2::XDictionaryListEventListener *) this );
static_cast<linguistic2::XDictionaryListEventListener *>(this) );
xDicList = 0;
}
}
......@@ -423,7 +423,7 @@ bool LngSvcMgrListenerHelper::AddLngSvcEvtBroadcaster(
{
aLngSvcEvtBroadcasters.addInterface( rxBroadcaster );
rxBroadcaster->addLinguServiceEventListener(
(linguistic2::XLinguServiceEventListener *) this );
static_cast<linguistic2::XLinguServiceEventListener *>(this) );
}
return bRes;
}
......@@ -437,7 +437,7 @@ bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster(
{
aLngSvcEvtBroadcasters.removeInterface( rxBroadcaster );
rxBroadcaster->removeLinguServiceEventListener(
(linguistic2::XLinguServiceEventListener *) this );
static_cast<linguistic2::XLinguServiceEventListener *>(this) );
}
return bRes;
}
......@@ -985,7 +985,7 @@ void LngSvcMgr::GetListenerHelper_Impl()
if (!pListenerHelper)
{
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(
const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/ )
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;
}
......
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