diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-02 13:37:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-03 15:20:04 +0200 |
commit | a28e7f7aa995f8c2c9e4eda332c30853338c7ae9 (patch) | |
tree | 06c5b8defd421e567dcbb1fde5eb91aae1438125 /dbaccess | |
parent | 0abf268f3893ecc716088aa399e81a1ef31e13d2 (diff) |
loplugin: cstylecast
Change-Id: Ie478d1fcfd3b64d7a2128887c216b5e0b4501ab9
Diffstat (limited to 'dbaccess')
34 files changed, 113 insertions, 113 deletions
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index e65092f39882..122182bdf1d0 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -429,7 +429,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto // obtain the data source we belong to, and the TableTypeFilterMode setting Any aFilterModeSetting; - if ( getDataSourceSetting( getDataSource( (Reference< XInterface >)m_rParent ), "TableTypeFilterMode", aFilterModeSetting ) ) + if ( getDataSourceSetting( getDataSource( Reference< XInterface >(m_rParent) ), "TableTypeFilterMode", aFilterModeSetting ) ) { OSL_VERIFY( aFilterModeSetting >>= nFilterMode ); } diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 19b99714160c..28b797671137 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -323,7 +323,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra variable to be set - OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL)); + OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>())); m_aKeyMap.insert(OKeySetMatrix::value_type(0, keySetValue)); m_aKeyIter = m_aKeyMap.begin(); } @@ -333,7 +333,7 @@ void OKeySet::reset(const Reference< XResultSet>& _xDriverSet) OCacheSet::construct(_xDriverSet, m_sRowSetFilter); m_bRowCountFinal = false; m_aKeyMap.clear(); - OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL)); + OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>())); m_aKeyMap.insert(OKeySetMatrix::value_type(0,keySetValue)); m_aKeyIter = m_aKeyMap.begin(); } @@ -893,7 +893,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >(m_pKeyColumnNames->size()); copyRowValue(_rInsertRow,aKeyRow,aKeyIter->first + 1); - m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(1,(Reference<XRow>)NULL)))).first; + m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(1,Reference<XRow>())))).first; // now we set the bookmark for this row (_rInsertRow->get())[0] = makeAny((sal_Int32)m_aKeyIter->first); tryRefetch(_rInsertRow,bRefetch); @@ -1448,7 +1448,7 @@ bool OKeySet::fetchRow() const SelectColumnDescription& rColDesc = aPosIter->second; aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xRow); } - m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL)))).first; + m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>())))).first; } else m_bRowCountFinal = true; diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index 12b3e986dd26..69cfa7d6530f 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -125,7 +125,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const OU // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra variable to be set - OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,(Reference<XRow>)NULL)); + OKeySetValue keySetValue((ORowSetValueVector *)NULL,::std::pair<sal_Int32,Reference<XRow> >(0,Reference<XRow>())); m_aKeyMap.insert(OKeySetMatrix::value_type(0,keySetValue)); m_aKeyIter = m_aKeyMap.begin(); diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 5912aa933fbd..ea2e92989276 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1129,7 +1129,7 @@ void ORowSet::notifyAllListenersCursorMoved(::osl::ResettableMutexGuard& _rGuard void ORowSet::notifyAllListenersRowChanged(::osl::ResettableMutexGuard& _rGuard, const RowsChangeEvent& aEvt) { _rGuard.clear(); - m_aRowsetListeners.notifyEach( &XRowSetListener::rowChanged, (EventObject)aEvt ); + m_aRowsetListeners.notifyEach( &XRowSetListener::rowChanged, static_cast<EventObject>(aEvt) ); m_aRowsChangeListener.notifyEach( &XRowsChangeListener::rowsChanged, aEvt ); _rGuard.reset(); } diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index 4fbbb0bf5034..57a3dc12e7b6 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -242,7 +242,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) for (; k != m_pCache->getEnd(); ++k) { ORowSetValueVector* pTemp = k->get(); - OSL_ENSURE( pTemp != (void*)0xfeeefeee,"HALT!" ); + OSL_ENSURE( pTemp != reinterpret_cast<void*>(0xfeeefeee),"HALT!" ); } #endif OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow < m_pCache->getEnd() && aCacheIter != m_pCache->m_aCacheIterators.end(),"Invalid iterator set for currentrow!"); diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 99a647d17027..fd1dbc38d6f8 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -252,7 +252,7 @@ Reference< XInterface > SAL_CALL ODatabaseContext::createInstance( ) throw (Exc Reference< XInterface > SAL_CALL ODatabaseContext::createInstanceWithArguments( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException, std::exception) { ::comphelper::NamedValueCollection aArgs( _rArguments ); - OUString sURL = aArgs.getOrDefault( (OUString)INFO_POOLURL, OUString() ); + OUString sURL = aArgs.getOrDefault( OUString(INFO_POOLURL), OUString() ); Reference< XInterface > xDataSource; if ( !sURL.isEmpty() ) diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index 259d0613ce95..29dd1f4298b1 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1619,7 +1619,7 @@ void ODatabaseDocument::impl_writeStorage_throw( const Reference< XStorage >& _r aDelegatorArguments[nArgsLen++] <<= xInfoSet; Reference< XPropertySet > xProp( _rxTargetStorage, UNO_QUERY_THROW ); - xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( (OUString)MIMETYPE_OASIS_OPENDOCUMENT_DATABASE ) ); + xProp->setPropertyValue( INFO_MEDIATYPE, makeAny( OUString(MIMETYPE_OASIS_OPENDOCUMENT_DATABASE) ) ); OUString aVersion; SvtSaveOptions::ODFDefaultVersion const nDefVersion = diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index 189612c5de19..9f845737bc03 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -602,7 +602,7 @@ void ODefinitionContainer::approveNewObject(const OUString& _sName,const Referen void SAL_CALL ODefinitionContainer::propertyChange( const PropertyChangeEvent& evt ) throw (RuntimeException, std::exception) { ClearableMutexGuard aGuard(m_aMutex); - if( evt.PropertyName == (OUString) PROPERTY_NAME || evt.PropertyName == "Title" ) + if( evt.PropertyName == PROPERTY_NAME || evt.PropertyName == "Title" ) { m_bInPropertyChange = true; try @@ -629,7 +629,7 @@ void SAL_CALL ODefinitionContainer::vetoableChange( const PropertyChangeEvent& a { MutexGuard aGuard(m_aMutex); - if( aEvent.PropertyName == (OUString) PROPERTY_NAME || aEvent.PropertyName == "Title" ) + if( aEvent.PropertyName == PROPERTY_NAME || aEvent.PropertyName == "Title" ) { OUString sNewName; aEvent.NewValue >>= sNewName; diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx index 8aaeb3b510fd..c457334de3e7 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -434,7 +434,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU else { ::comphelper::NamedValueCollection aCreationArgs; - aCreationArgs.put( (OUString)INFO_POOLURL, sSalvagedURL ); + aCreationArgs.put( OUString(INFO_POOLURL), sSalvagedURL ); xDocumentDataSource.set( xDatabaseContext->createInstanceWithArguments( aCreationArgs.getWrappedNamedValues() ), UNO_QUERY_THROW ); } diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 0c03368c977a..7568034d6b77 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -840,9 +840,9 @@ SvXMLImportContext* ODBFilter::CreateStylesContext(sal_uInt16 _nPrefix,const OUS { pContext = new OTableStylesContext(*this, _nPrefix, rLocalName, xAttrList, bIsAutoStyle); if (bIsAutoStyle) - SetAutoStyles((SvXMLStylesContext*)pContext); + SetAutoStyles(static_cast<SvXMLStylesContext*>(pContext)); else - SetStyles((SvXMLStylesContext*)pContext); + SetStyles(static_cast<SvXMLStylesContext*>(pContext)); } return pContext; } diff --git a/dbaccess/source/sdbtools/connection/connectiondependent.hxx b/dbaccess/source/sdbtools/connection/connectiondependent.hxx index b6cc94f16b88..e9f06398a772 100644 --- a/dbaccess/source/sdbtools/connection/connectiondependent.hxx +++ b/dbaccess/source/sdbtools/connection/connectiondependent.hxx @@ -90,7 +90,7 @@ namespace sdbtools inline bool acquireConnection( GuardAccess ) { - m_xConnection = (::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >)m_aConnection; + m_xConnection = ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >(m_aConnection); return m_xConnection.is(); } inline void releaseConnection( GuardAccess ) diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 6eee77829d60..fe3f5a784ced 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -1225,7 +1225,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa eType = E_QUERY; break; case ID_NEW_QUERY_DESIGN: - aCreationArgs.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True ); + aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), sal_True ); // run through case ID_NEW_QUERY_SQL: eType = E_QUERY; @@ -1263,7 +1263,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa QueryDesigner aDesigner( getORB(), this, getFrame(), true ); ::comphelper::NamedValueCollection aCreationArgs; - aCreationArgs.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, ID_NEW_VIEW_DESIGN == _nId ); + aCreationArgs.put( OUString(PROPERTY_GRAPHICAL_DESIGN), ID_NEW_VIEW_DESIGN == _nId ); const Reference< XDataSource > xDataSource( m_xDataSource, UNO_QUERY ); const Reference< XComponent > xComponent( aDesigner.createNew( xDataSource, aCreationArgs ), UNO_QUERY ); @@ -1868,7 +1868,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const if ( bAddViewTypeArg ) { const bool bQueryGraphicalMode =( _nInstigatorCommand != SID_DB_APP_EDIT_SQL_VIEW ); - aArguments.put( (OUString)PROPERTY_GRAPHICAL_DESIGN, bQueryGraphicalMode ); + aArguments.put( OUString(PROPERTY_GRAPHICAL_DESIGN), bQueryGraphicalMode ); } } @@ -1876,8 +1876,8 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const { pDesigner.reset( new ResultSetBrowser( getORB(), this, m_aCurrentFrame.getFrame(), _eType == E_TABLE ) ); - if ( !aArguments.has( (OUString)PROPERTY_SHOWMENU ) ) - aArguments.put( (OUString)PROPERTY_SHOWMENU, makeAny( true ) ); + if ( !aArguments.has( OUString(PROPERTY_SHOWMENU) ) ) + aArguments.put( OUString(PROPERTY_SHOWMENU), makeAny( true ) ); aDataSource <<= getDatabaseName(); } @@ -2711,9 +2711,9 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel > { // to get the 'modified' for the data source ::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) ); - if ( aLayoutInfo.has( (OUString)INFO_PREVIEW ) ) + if ( aLayoutInfo.has( OUString(INFO_PREVIEW) ) ) { - const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( (OUString)INFO_PREVIEW, (sal_Int32)0 ) ); + const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( OUString(INFO_PREVIEW), (sal_Int32)0 ) ); m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode ); if ( getView() ) getContainer()->switchPreview( m_ePreviewMode ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index af80ee80ad34..eadf7a03376c 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -1146,7 +1146,7 @@ void OAppDetailPageHelper::showPreview( const OUString& _sDataSourceName, aArgs.put( "Preview", sal_True ); aArgs.put( "ReadOnly", sal_True ); aArgs.put( "AsTemplate", sal_False ); - aArgs.put( (OUString)PROPERTY_SHOWMENU, sal_False ); + aArgs.put( OUString(PROPERTY_SHOWMENU), sal_False ); Reference< XController > xPreview( pDispatcher->openExisting( makeAny( _sDataSourceName ), _sName, aArgs ), UNO_QUERY ); bool bClearPreview = !xPreview.is(); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index dfa6774cb25f..9d67df969ea1 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1480,7 +1480,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const CellControllerRef xCurrentController = getBrowserView()->getVclControl()->Controller(); if (xCurrentController.Is() && xCurrentController->ISA(EditCellController)) { - Edit& rEdit = (Edit&)xCurrentController->GetWindow(); + Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow()); bool bHasLen = (rEdit.GetSelection().Len() != 0); bool bIsReadOnly = rEdit.IsReadOnly(); switch (nId) @@ -1964,7 +1964,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property // enabled. This would be really deadly herein if the current cell has no controller ... return; - Edit& rEdit = (Edit&)xCurrentController->GetWindow(); + Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow()); switch (nId) { case ID_BROWSER_CUT : rEdit.Cut(); break; diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index fb5bae3b9f6c..74fc745b597e 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -192,7 +192,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU if ( sComponentURL == URL_COMPONENT_DATASOURCEBROWSER ) { bool bDisableBrowser = ( sal_False == aLoadArgs.getOrDefault( "ShowTreeViewButton", sal_True ) ) // compatibility name - || ( sal_False == aLoadArgs.getOrDefault( (OUString)PROPERTY_ENABLE_BROWSER, sal_True ) ); + || ( sal_False == aLoadArgs.getOrDefault( OUString(PROPERTY_ENABLE_BROWSER), sal_True ) ); if ( bDisableBrowser ) { diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index abdaf7c24934..d6e47e661581 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -126,7 +126,7 @@ void SbaExternalSourceBrowser::modified(const ::com::sun::star::lang::EventObjec ::com::sun::star::lang::EventObject aEvt(*this); ::cppu::OInterfaceIteratorHelper aIt(m_aModifyListeners); while (aIt.hasMoreElements()) - ((::com::sun::star::util::XModifyListener*)aIt.next())->modified(aEvt); + static_cast< ::com::sun::star::util::XModifyListener*>(aIt.next())->modified(aEvt); } void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::URL& aURL, const Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) throw(::com::sun::star::uno::RuntimeException, std::exception) diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index bac906e81cc8..41aa59b47f06 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -171,7 +171,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe ::com::sun::star::lang::EventObject aEvt(*this); ::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners); while (aIt.hasMoreElements()) - ((::com::sun::star::form::XLoadListener*)aIt.next())->unloaded(aEvt); + static_cast< ::com::sun::star::form::XLoadListener*>(aIt.next())->unloaded(aEvt); } } @@ -188,7 +188,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe ::com::sun::star::lang::EventObject aEvt(*this); ::cppu::OInterfaceIteratorHelper aIt(m_aLoadListeners); while (aIt.hasMoreElements()) - ((::com::sun::star::form::XLoadListener*)aIt.next())->loaded(aEvt); + static_cast< ::com::sun::star::form::XLoadListener*>(aIt.next())->loaded(aEvt); } } @@ -1142,7 +1142,7 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any ::cppu::OInterfaceIteratorHelper aIt(*m_aPropertyChangeListeners.getContainer(PROPERTY_NAME)); while (aIt.hasMoreElements()) - ((::com::sun::star::beans::XPropertyChangeListener*)aIt.next())->propertyChange(aEvt); + static_cast< ::com::sun::star::beans::XPropertyChangeListener*>(aIt.next())->propertyChange(aEvt); return; } @@ -1425,7 +1425,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const OU aEvt.Element <<= xElement; ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners); while (aIt.hasMoreElements()) - ((::com::sun::star::container::XContainerListener*)aIt.next())->elementInserted(aEvt); + static_cast< ::com::sun::star::container::XContainerListener*>(aIt.next())->elementInserted(aEvt); } sal_Int32 SbaXFormAdapter::implGetPos(const OUString& rName) @@ -1531,7 +1531,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( ::com::su aEvt.Element <<= xAffected; ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners); while (aIt.hasMoreElements()) - ((::com::sun::star::container::XContainerListener*)aIt.next())->elementRemoved(aEvt); + static_cast< ::com::sun::star::container::XContainerListener*>(aIt.next())->elementRemoved(aEvt); } @@ -1594,7 +1594,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem ::cppu::OInterfaceIteratorHelper aIt(m_aContainerListeners); while (aIt.hasMoreElements()) - ((::com::sun::star::container::XContainerListener*)aIt.next())->elementReplaced(aEvt); + static_cast< ::com::sun::star::container::XContainerListener*>(aIt.next())->elementReplaced(aEvt); } // ::com::sun::star::container::XIndexAccess diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index c8526427cbf3..afbdc240b37a 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -123,7 +123,7 @@ void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< Prop { try { - Reference< XController > xController( (Reference< XController >)m_aController, UNO_SET_THROW ); + Reference< XController > xController( Reference< XController >(m_aController), UNO_SET_THROW ); Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW ); Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch( _rFeatureURL, diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 125b881af63c..abfe3bdbe229 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -309,7 +309,7 @@ void SAL_CALL SbaXGridPeer::dispose(void) throw( RuntimeException, std::exceptio void SbaXGridPeer::NotifyStatusChanged(const ::com::sun::star::util::URL& _rUrl, const Reference< ::com::sun::star::frame::XStatusListener > & xControl) { - SbaGridControl* pGrid = (SbaGridControl*) GetWindow(); + SbaGridControl* pGrid = static_cast<SbaGridControl*>(GetWindow()); if (!pGrid) return; @@ -334,7 +334,7 @@ void SbaXGridPeer::NotifyStatusChanged(const ::com::sun::star::util::URL& _rUrl, { ::cppu::OInterfaceIteratorHelper aListIter(*pIter); while (aListIter.hasMoreElements()) - ((::com::sun::star::frame::XStatusListener*)aListIter.next())->statusChanged(aEvt); + static_cast< ::com::sun::star::frame::XStatusListener*>(aListIter.next())->statusChanged(aEvt); } } } @@ -398,7 +398,7 @@ SbaXGridPeer::DispatchType SbaXGridPeer::classifyDispatchURL( const URL& _rURL ) void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyValue >& aArgs) throw( RuntimeException, std::exception ) { - SbaGridControl* pGrid = (SbaGridControl*)GetWindow(); + SbaGridControl* pGrid = static_cast<SbaGridControl*>(GetWindow()); if (!pGrid) return; @@ -621,7 +621,7 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rM FmGridHeader::PreExecuteColumnContextMenu(nColId, rMenu); // some items are valid only if the db isn't readonly - bool bDBIsReadOnly = ((SbaGridControl*)GetParent())->IsReadOnlyDB(); + bool bDBIsReadOnly = static_cast<SbaGridControl*>(GetParent())->IsReadOnlyDB(); if (bDBIsReadOnly) { @@ -644,8 +644,8 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rM { PopupMenu aNewItems(ModuleRes(RID_SBA_GRID_COLCTXMENU)); sal_uInt16 nPos = 0; - sal_uInt16 nModelPos = ((SbaGridControl*)GetParent())->GetModelColumnPos(nColId); - Reference< XPropertySet > xField = ((SbaGridControl*)GetParent())->getField(nModelPos); + sal_uInt16 nModelPos = static_cast<SbaGridControl*>(GetParent())->GetModelColumnPos(nColId); + Reference< XPropertySet > xField = static_cast<SbaGridControl*>(GetParent())->getField(nModelPos); if ( xField.is() ) { @@ -678,16 +678,16 @@ void SbaGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupM switch (nExecutionResult) { case ID_BROWSER_COLWIDTH: - ((SbaGridControl*)GetParent())->SetColWidth(nColId); + static_cast<SbaGridControl*>(GetParent())->SetColWidth(nColId); break; case ID_BROWSER_COLATTRSET: - ((SbaGridControl*)GetParent())->SetColAttrs(nColId); + static_cast<SbaGridControl*>(GetParent())->SetColAttrs(nColId); break; case ID_BROWSER_COLUMNINFO: { - sal_uInt16 nModelPos = ((SbaGridControl*)GetParent())->GetModelColumnPos(nColId); - Reference< XPropertySet > xField = ((SbaGridControl*)GetParent())->getField(nModelPos); + sal_uInt16 nModelPos = static_cast<SbaGridControl*>(GetParent())->GetModelColumnPos(nColId); + Reference< XPropertySet > xField = static_cast<SbaGridControl*>(GetParent())->getField(nModelPos); if(!xField.is()) break; @@ -1381,7 +1381,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) CellControllerRef xCurrentController = Controller(); if (!xCurrentController.Is() || !xCurrentController->ISA(EditCellController)) return DND_ACTION_NONE; - Edit& rEdit = (Edit&)xCurrentController->GetWindow(); + Edit& rEdit = static_cast<Edit&>(xCurrentController->GetWindow()); // get the dropped string TransferableDataHelper aDropped( rEvt.maDropEvent.Transferable ); diff --git a/dbaccess/source/ui/browser/sbamultiplex.cxx b/dbaccess/source/ui/browser/sbamultiplex.cxx index 743b12b0380d..815f6745aff8 100644 --- a/dbaccess/source/ui/browser/sbamultiplex.cxx +++ b/dbaccess/source/ui/browser/sbamultiplex.cxx @@ -91,7 +91,7 @@ void SbaXPropertiesChangeMultiplexer::propertiesChange(const ::com::sun::star::u ::cppu::OInterfaceIteratorHelper aIt(*this); while (aIt.hasMoreElements()) - ((::com::sun::star::beans::XPropertiesChangeListener*)aIt.next())->propertiesChange(aMulti); + static_cast< ::com::sun::star::beans::XPropertiesChangeListener*>(aIt.next())->propertiesChange(aMulti); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index b18678a763d4..bda7e28640f8 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2295,7 +2295,7 @@ bool SbaTableQueryBrowser::ensureEntryObject( SvTreeListEntry* _pEntry ) SvTreeListEntry* pParent = m_pTreeView->getListBox().GetParent(_pEntry); if ( pParent != pDataSourceEntry ) { - SvLBoxString* pString = (SvLBoxString*)_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING); + SvLBoxString* pString = static_cast<SvLBoxString*>(_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING)); OSL_ENSURE(pString,"There must be a string item!"); OUString aName(pString->GetText()); DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pParent->GetUserData()); @@ -2546,7 +2546,7 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) Reference<XConnection> xOldConnection(xRowSetProps->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY); // the name of the table or query - SvLBoxString* pString = (SvLBoxString*)_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING); + SvLBoxString* pString = static_cast<SvLBoxString*>(_pEntry->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING)); OSL_ENSURE(pString,"There must be a string item!"); const OUString sSimpleName = pString->GetText(); OUStringBuffer sNameBuffer(sSimpleName); @@ -2556,7 +2556,7 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) while( m_pTreeModel->GetParent(pTemp) != pConnection ) { sNameBuffer.insert(0,'/'); - pString = (SvLBoxString*)pTemp->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING); + pString = static_cast<SvLBoxString*>(pTemp->GetFirstItem(SV_ITEM_ID_BOLDLBSTRING)); OSL_ENSURE(pString,"There must be a string item!"); sNameBuffer.insert(0,pString->GetText()); pTemp = m_pTreeModel->GetParent(pTemp); @@ -3096,21 +3096,21 @@ void SbaTableQueryBrowser::impl_initialize() const NamedValueCollection& rArguments( getInitParams() ); - rArguments.get_ensureType( (OUString)PROPERTY_DATASOURCENAME, sInitialDataSourceName ); - rArguments.get_ensureType( (OUString)PROPERTY_COMMAND_TYPE, nInitialDisplayCommandType ); - rArguments.get_ensureType( (OUString)PROPERTY_COMMAND, sInitialCommand ); - rArguments.get_ensureType( (OUString)PROPERTY_ACTIVE_CONNECTION, xForeignConnection ); - rArguments.get_ensureType( (OUString)PROPERTY_UPDATE_CATALOGNAME, aCatalogName ); - rArguments.get_ensureType( (OUString)PROPERTY_UPDATE_SCHEMANAME, aSchemaName ); - rArguments.get_ensureType( (OUString)PROPERTY_UPDATE_TABLENAME, aTableName ); - rArguments.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, bEsacpeProcessing ); + rArguments.get_ensureType( OUString(PROPERTY_DATASOURCENAME), sInitialDataSourceName ); + rArguments.get_ensureType( OUString(PROPERTY_COMMAND_TYPE), nInitialDisplayCommandType ); + rArguments.get_ensureType( OUString(PROPERTY_COMMAND), sInitialCommand ); + rArguments.get_ensureType( OUString(PROPERTY_ACTIVE_CONNECTION), xForeignConnection ); + rArguments.get_ensureType( OUString(PROPERTY_UPDATE_CATALOGNAME), aCatalogName ); + rArguments.get_ensureType( OUString(PROPERTY_UPDATE_SCHEMANAME), aSchemaName ); + rArguments.get_ensureType( OUString(PROPERTY_UPDATE_TABLENAME), aTableName ); + rArguments.get_ensureType( OUString(PROPERTY_ESCAPE_PROCESSING), bEsacpeProcessing ); rArguments.get_ensureType( "Frame", xFrame ); - rArguments.get_ensureType( (OUString)PROPERTY_SHOWMENU, m_bShowMenu ); + rArguments.get_ensureType( OUString(PROPERTY_SHOWMENU), m_bShowMenu ); // disable the browser if either of ShowTreeViewButton (compatibility name) or EnableBrowser // is present and set to FALSE bool bDisableBrowser = ( sal_False == rArguments.getOrDefault( "ShowTreeViewButton", sal_True ) ) // compatibility name - || ( sal_False == rArguments.getOrDefault( (OUString)PROPERTY_ENABLE_BROWSER, sal_True ) ); + || ( sal_False == rArguments.getOrDefault( OUString(PROPERTY_ENABLE_BROWSER), sal_True ) ); OSL_ENSURE( !rArguments.has( "ShowTreeViewButton" ), "SbaTableQueryBrowser::impl_initialize: ShowTreeViewButton is superseded by EnableBrowser!" ); m_bEnableBrowser = !bDisableBrowser; @@ -3118,7 +3118,7 @@ void SbaTableQueryBrowser::impl_initialize() // hide the tree view it is disabled in general, or if the settings tell to hide it initially bool bHideTreeView = ( !m_bEnableBrowser ) || ( sal_False == rArguments.getOrDefault( "ShowTreeView", sal_True ) ) // compatibility name - || ( sal_False == rArguments.getOrDefault( (OUString)PROPERTY_SHOW_BROWSER, sal_True ) ); + || ( sal_False == rArguments.getOrDefault( OUString(PROPERTY_SHOW_BROWSER), sal_True ) ); OSL_ENSURE( !rArguments.has( "ShowTreeView" ), "SbaTableQueryBrowser::impl_initialize: ShowTreeView is superseded by ShowBrowser!" ); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index d0c35b7cd759..351a070ddbf2 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -936,7 +936,7 @@ void OFieldDescControl::InitializeControl(Control* _pControl,const OString& _sHe { _pControl->SetHelpId(_sHelpId); if ( _bAddChangeHandler ) - ((OPropListBoxCtrl*)_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); + static_cast<OPropListBoxCtrl*>(_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); _pControl->SetGetFocusHdl(LINK(this, OFieldDescControl, OnControlFocusGot)); _pControl->SetLoseFocusHdl(LINK(this, OFieldDescControl, OnControlFocusLost)); @@ -1465,25 +1465,25 @@ IMPL_LINK(OFieldDescControl, OnControlFocusLost, Control*, pControl ) { if ((pControl == pLength) || (pControl == pTextLen) || (pControl == pScale)) { - OPropNumericEditCtrl* pConverted = (OPropNumericEditCtrl*)pControl; + OPropNumericEditCtrl* pConverted = static_cast<OPropNumericEditCtrl*>(pControl); if (pConverted->IsModified()) CellModified(-1, pConverted->GetPos()); } if(pControl == m_pColumnName) { - OPropColumnEditCtrl* pConverted = (OPropColumnEditCtrl*)pControl; + OPropColumnEditCtrl* pConverted = static_cast<OPropColumnEditCtrl*>(pControl); if (pConverted->IsModified()) CellModified(-1, pConverted->GetPos()); } else if ((pControl == pDefault) || (pControl == pFormatSample) || (pControl == m_pAutoIncrementValue) ) { - OPropEditCtrl* pConverted = (OPropEditCtrl*)pControl; + OPropEditCtrl* pConverted = static_cast<OPropEditCtrl*>(pControl); if (pConverted->IsModified()) CellModified(-1, pConverted->GetPos()); } else if ((pControl == pRequired) || (pControl == pNumType) || (pControl == pAutoIncrement) || (pControl == pBoolDefault) || (pControl == m_pType)) { - OPropListBoxCtrl* pConverted = (OPropListBoxCtrl*)pControl; + OPropListBoxCtrl* pConverted = static_cast<OPropListBoxCtrl*>(pControl); if (pConverted->IsModified()) CellModified(-1, pConverted->GetPos()); } diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index c301918eb9c7..63d3f33b28c6 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -64,7 +64,7 @@ typedef SQLRETURN (SQL_API* TSQLDataSources) (SQLHENV EnvironmentHandle, SQLUSMA #define NSQLAllocHandle(a,b,c) (*(TSQLAllocHandle)(m_pAllocHandle))(a,b,c) #define NSQLFreeHandle(a,b) (*(TSQLFreeHandle)(m_pFreeHandle))(a,b) -#define NSQLSetEnvAttr(a,b,c,d) (*(TSQLSetEnvAttr)(m_pSetEnvAttr))(a,b,c,d) +#define NSQLSetEnvAttr(a,b,c,d) (*reinterpret_cast<TSQLSetEnvAttr>(m_pSetEnvAttr))(a,b,c,d) #define NSQLDataSources(a,b,c,d,e,f,g,h) (*(TSQLDataSources)(m_pDataSources))(a,b,c,d,e,f,g,h) #endif @@ -179,7 +179,7 @@ bool OOdbcEnumeration::allocEnv() // can't do anything without environment return false; - NSQLSetEnvAttr(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER); + NSQLSetEnvAttr(m_pImpl->hEnvironment, SQL_ATTR_ODBC_VERSION, reinterpret_cast<SQLPOINTER>(SQL_OV_ODBC3), SQL_IS_INTEGER); return true; #else return sal_False; diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index f3978ebf0684..ee5a791e2357 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -798,7 +798,7 @@ void ODatabaseExport::ensureFormatter() { Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier(); Reference< XUnoTunnel > xTunnel(xSupplier,UNO_QUERY); - SvNumberFormatsSupplierObj* pSupplierImpl = (SvNumberFormatsSupplierObj*)sal::static_int_cast< sal_IntPtr >(xTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); + SvNumberFormatsSupplierObj* pSupplierImpl = reinterpret_cast<SvNumberFormatsSupplierObj*>(xTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); m_pFormatter = pSupplierImpl ? pSupplierImpl->GetNumberFormatter() : NULL; Reference<XPropertySet> xNumberFormatSettings = xSupplier->getNumberFormatSettings(); xNumberFormatSettings->getPropertyValue("NullDate") >>= m_aNullDate; diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 1c1b8952d2dd..64d7d4162f24 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -607,10 +607,10 @@ bool ORTFImportExport::Read() if ( m_pStream ) { m_pReader = new ORTFReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext); - ((ORTFReader*)m_pReader)->AddFirstRef(); + static_cast<ORTFReader*>(m_pReader)->AddFirstRef(); if ( isCheckEnabled() ) m_pReader->enableCheckOnly(); - eState = ((ORTFReader*)m_pReader)->CallParser(); + eState = static_cast<ORTFReader*>(m_pReader)->CallParser(); m_pReader->release(); m_pReader = NULL; } @@ -678,11 +678,11 @@ bool OHTMLImportExport::Read() if ( m_pStream ) { m_pReader = new OHTMLReader((*m_pStream),m_xConnection,m_xFormatter,m_xContext); - ((OHTMLReader*)m_pReader)->AddFirstRef(); + static_cast<OHTMLReader*>(m_pReader)->AddFirstRef(); if ( isCheckEnabled() ) m_pReader->enableCheckOnly(); m_pReader->SetTableName(m_sDefaultTableName); - eState = ((OHTMLReader*)m_pReader)->CallParser(); + eState = static_cast<OHTMLReader*>(m_pReader)->CallParser(); m_pReader->release(); m_pReader = NULL; } diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 505ef7793602..9fc6725774fe 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -937,7 +937,7 @@ void OCopyTableWizard::setCreatePrimaryKey( bool _bDoCreate, const OUString& _rS IMPL_LINK_NOARG(OCopyTableWizard, ImplActivateHdl) { - OWizardPage* pCurrent = (OWizardPage*)GetPage(GetCurLevel()); + OWizardPage* pCurrent = static_cast<OWizardPage*>(GetPage(GetCurLevel())); if(pCurrent) { bool bFirstTime = pCurrent->IsFirstTime(); @@ -991,7 +991,7 @@ void OCopyTableWizard::EnableButton(Wizard_Button_Style eStyle, bool bEnable) long OCopyTableWizard::DeactivatePage() { - OWizardPage* pPage = (OWizardPage*)GetPage(GetCurLevel()); + OWizardPage* pPage = static_cast<OWizardPage*>(GetPage(GetCurLevel())); return pPage ? pPage->LeavePage() : sal_False; } diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 3bb89f9127ee..72e97daf5449 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -87,7 +87,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) OSL_ENSURE(nRow == -1,"nRow muss -1 sein!"); (void)nRow; - MultiListBox *pListBox = ((OWizTypeSelect*)m_pParentTabPage)->m_pColumnNames; + MultiListBox *pListBox = static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pColumnNames; OFieldDescription* pCurFieldDescr = getCurrentFieldDescData(); @@ -192,22 +192,22 @@ const OTypeInfoMap* OWizTypeSelectControl::getTypeInfo() const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> OWizTypeSelectControl::getMetaData() { - return ((OWizTypeSelect*)m_pParentTabPage)->m_pParent->m_xDestConnection->getMetaData(); + return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection->getMetaData(); } ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> OWizTypeSelectControl::getConnection() { - return ((OWizTypeSelect*)m_pParentTabPage)->m_pParent->m_xDestConnection; + return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_pParent->m_xDestConnection; } bool OWizTypeSelectControl::isAutoIncrementValueEnabled() const { - return ((OWizTypeSelect*)m_pParentTabPage)->m_bAutoIncrementEnabled; + return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_bAutoIncrementEnabled; } OUString OWizTypeSelectControl::getAutoIncrementValue() const { - return ((OWizTypeSelect*)m_pParentTabPage)->m_sAutoIncrementValue; + return static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_sAutoIncrementValue; } #define IMG_PRIMARY_KEY 1 @@ -364,7 +364,7 @@ void OWizTypeSelectList::setPrimaryKey(OFieldDescription* _pFieldDescr, sal_uInt RemoveEntry(_nPos); _pFieldDescr->SetPrimaryKey(_bSet); if( _bSet ) - InsertEntry(sColumnName,((OWizTypeSelect*)m_pParentTabPage)->m_imgPKey,_nPos); + InsertEntry(sColumnName, static_cast<OWizTypeSelect*>(m_pParentTabPage)->m_imgPKey,_nPos); else if( _pFieldDescr->getTypeInfo()->bNullable ) { _pFieldDescr->SetControlDefault(Any()); diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index bd5de5f1c238..e40734ff2eb4 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -164,14 +164,14 @@ namespace dbaui Reference<XDataSource> xDataSource; if ( _aDataSource >>= sDataSource ) { - i_rDispatchArgs.put( (OUString)PROPERTY_DATASOURCENAME, sDataSource ); + i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCENAME), sDataSource ); } else if ( _aDataSource >>= xDataSource ) { - i_rDispatchArgs.put( (OUString)PROPERTY_DATASOURCE, xDataSource ); + i_rDispatchArgs.put( OUString(PROPERTY_DATASOURCE), xDataSource ); } - i_rDispatchArgs.put( (OUString)PROPERTY_ACTIVE_CONNECTION, getConnection() ); + i_rDispatchArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), getConnection() ); } // QueryDesigner @@ -188,19 +188,19 @@ namespace dbaui DatabaseObjectView::fillDispatchArgs( i_rDispatchArgs, _aDataSource, _rObjectName ); const bool bIncludeQueryName = !_rObjectName.isEmpty(); - const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( (OUString)PROPERTY_GRAPHICAL_DESIGN, sal_True ); + const bool bGraphicalDesign = i_rDispatchArgs.getOrDefault( OUString(PROPERTY_GRAPHICAL_DESIGN), sal_True ); const bool bEditViewAsSQLCommand = ( m_nCommandType == CommandType::TABLE ) && !bGraphicalDesign; - i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND_TYPE, m_nCommandType ); + i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), m_nCommandType ); if ( bIncludeQueryName ) { - i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND, _rObjectName ); + i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rObjectName ); } if ( bEditViewAsSQLCommand ) { - i_rDispatchArgs.put( (OUString)PROPERTY_ESCAPE_PROCESSING, sal_False ); + i_rDispatchArgs.put( OUString(PROPERTY_ESCAPE_PROCESSING), sal_False ); } } @@ -217,7 +217,7 @@ namespace dbaui if ( !_rObjectName.isEmpty() ) { - i_rDispatchArgs.put( (OUString)PROPERTY_CURRENTTABLE, _rObjectName ); + i_rDispatchArgs.put( OUString(PROPERTY_CURRENTTABLE), _rObjectName ); } } @@ -283,15 +283,15 @@ namespace dbaui if ( m_bTable ) ::dbtools::qualifiedNameComponents( getConnection()->getMetaData(), _rQualifiedName, sCatalog, sSchema, sTable, ::dbtools::eInDataManipulation ); - i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND_TYPE, (m_bTable ? CommandType::TABLE : CommandType::QUERY) ); - i_rDispatchArgs.put( (OUString)PROPERTY_COMMAND, _rQualifiedName ); - i_rDispatchArgs.put( (OUString)PROPERTY_ENABLE_BROWSER, sal_False ); + i_rDispatchArgs.put( OUString(PROPERTY_COMMAND_TYPE), (m_bTable ? CommandType::TABLE : CommandType::QUERY) ); + i_rDispatchArgs.put( OUString(PROPERTY_COMMAND), _rQualifiedName ); + i_rDispatchArgs.put( OUString(PROPERTY_ENABLE_BROWSER), sal_False ); if ( m_bTable ) { - i_rDispatchArgs.put( (OUString)PROPERTY_UPDATE_CATALOGNAME, sCatalog ); - i_rDispatchArgs.put( (OUString)PROPERTY_UPDATE_SCHEMANAME, sSchema ); - i_rDispatchArgs.put( (OUString)PROPERTY_UPDATE_TABLENAME, sTable ); + i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_CATALOGNAME), sCatalog ); + i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_SCHEMANAME), sSchema ); + i_rDispatchArgs.put( OUString(PROPERTY_UPDATE_TABLENAME), sTable ); } } diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index edd50cf2534e..d9e44161f2e8 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -187,7 +187,7 @@ namespace dbaui const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); Reference< XConnection > xConnection; - xConnection = rArguments.getOrDefault( (OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); + xConnection = rArguments.getOrDefault( OUString(PROPERTY_ACTIVE_CONNECTION), xConnection ); if ( !xConnection.is() ) ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 04d417a67b2c..f203c417370b 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -151,7 +151,7 @@ namespace dbaui } aArguments.put( "OpenMode", sOpenMode ); - aArguments.put( (OUString)PROPERTY_ACTIVE_CONNECTION, m_xConnection ); + aArguments.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection ); try { Reference<XHierarchicalNameContainer> xHier(m_xDocumentContainer,UNO_QUERY); @@ -273,7 +273,7 @@ namespace dbaui ::comphelper::NamedValueCollection aCreationArgs( i_rCreationArgs ); if ( aClassId.getLength() ) aCreationArgs.put( "ClassID", aClassId ); - aCreationArgs.put( (OUString)PROPERTY_ACTIVE_CONNECTION, m_xConnection ); + aCreationArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection ); // separate values which are real creation args from args relevant for opening the doc ::comphelper::NamedValueCollection aCommandArgs; diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx index b10952367c30..ba4de09285fd 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx @@ -78,7 +78,7 @@ OConnectionLineDataRef OQueryTableConnectionData::CreateLineDataObj( const OConn void OQueryTableConnectionData::CopyFrom(const OTableConnectionData& rSource) { // same as in base class, use of (non-virtual) operator= - *this = (const OQueryTableConnectionData&)rSource; + *this = static_cast<const OQueryTableConnectionData&>(rSource); } OQueryTableConnectionData& OQueryTableConnectionData::operator=(const OQueryTableConnectionData& rConnData) @@ -121,7 +121,7 @@ void OQueryTableConnectionData::InitFromDrag(const OTableFieldDescRef& rDragLeft SetFieldType(JTCS_FROM, rDragLeft->GetFieldType()); SetFieldType(JTCS_TO, rDragRight->GetFieldType()); - AppendConnLine((OUString)rDragLeft->GetField(),(OUString)rDragRight->GetField()); + AppendConnLine(rDragLeft->GetField(), rDragRight->GetField()); } OTableConnectionData* OQueryTableConnectionData::NewInstance() const diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 20654daece80..1149d5fe6768 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -388,7 +388,7 @@ void SAL_CALL OQueryController::getFastPropertyValue( Any& o_rValue, sal_Int32 i { ::comphelper::NamedValueCollection aCurrentDesign; aCurrentDesign.put( "GraphicalDesign", isGraphicalDesign() ); - aCurrentDesign.put( (OUString)PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing ); + aCurrentDesign.put( OUString(PROPERTY_ESCAPE_PROCESSING), m_bEscapeProcessing ); if ( isGraphicalDesign() ) { @@ -888,8 +888,8 @@ void OQueryController::impl_initialize() } // non-legacy parameters which overwrite the legacy parameters - rArguments.get_ensureType( (OUString)PROPERTY_COMMAND, sCommand ); - rArguments.get_ensureType( (OUString)PROPERTY_COMMAND_TYPE, m_nCommandType ); + rArguments.get_ensureType( OUString(PROPERTY_COMMAND), sCommand ); + rArguments.get_ensureType( OUString(PROPERTY_COMMAND_TYPE), m_nCommandType ); // translate Command/Type into proper members // TODO/Later: all this (including those members) should be hidden behind some abstact interface, @@ -913,17 +913,17 @@ void OQueryController::impl_initialize() // more legacy parameters bool bGraphicalDesign( true ); - if ( rArguments.get_ensureType( (OUString)PROPERTY_QUERYDESIGNVIEW, bGraphicalDesign ) ) + if ( rArguments.get_ensureType( OUString(PROPERTY_QUERYDESIGNVIEW), bGraphicalDesign ) ) { OSL_FAIL( "OQueryController::impl_initialize: QueryDesignView is regognized for compatibility only!" ); m_bGraphicalDesign = bGraphicalDesign; } // more non-legacy - rArguments.get_ensureType( (OUString)PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign ); + rArguments.get_ensureType( OUString(PROPERTY_GRAPHICAL_DESIGN), m_bGraphicalDesign ); bool bEscapeProcessing( true ); - if ( rArguments.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, bEscapeProcessing ) ) + if ( rArguments.get_ensureType( OUString(PROPERTY_ESCAPE_PROCESSING), bEscapeProcessing ) ) { setEscapeProcessing_fireEvent( bEscapeProcessing ); @@ -940,13 +940,13 @@ void OQueryController::impl_initialize() if ( aCurrentQueryDesignProps.getLength() ) { ::comphelper::NamedValueCollection aCurrentQueryDesign( aCurrentQueryDesignProps ); - if ( aCurrentQueryDesign.has( (OUString)PROPERTY_GRAPHICAL_DESIGN ) ) + if ( aCurrentQueryDesign.has( OUString(PROPERTY_GRAPHICAL_DESIGN) ) ) { - aCurrentQueryDesign.get_ensureType( (OUString)PROPERTY_GRAPHICAL_DESIGN, m_bGraphicalDesign ); + aCurrentQueryDesign.get_ensureType( OUString(PROPERTY_GRAPHICAL_DESIGN), m_bGraphicalDesign ); } - if ( aCurrentQueryDesign.has( (OUString)PROPERTY_ESCAPE_PROCESSING ) ) + if ( aCurrentQueryDesign.has( OUString(PROPERTY_ESCAPE_PROCESSING) ) ) { - aCurrentQueryDesign.get_ensureType( (OUString)PROPERTY_ESCAPE_PROCESSING, m_bEscapeProcessing ); + aCurrentQueryDesign.get_ensureType( OUString(PROPERTY_ESCAPE_PROCESSING), m_bEscapeProcessing ); } if ( aCurrentQueryDesign.has( "Statement" ) ) { @@ -1987,7 +1987,7 @@ bool OQueryController::allowQueries() const return false; const NamedValueCollection& rArguments( getInitParams() ); - sal_Int32 nCommandType = rArguments.getOrDefault( (OUString)PROPERTY_COMMAND_TYPE, (sal_Int32)CommandType::QUERY ); + sal_Int32 nCommandType = rArguments.getOrDefault( OUString(PROPERTY_COMMAND_TYPE), (sal_Int32)CommandType::QUERY ); bool bCreatingView = ( nCommandType == CommandType::TABLE ); return !bCreatingView; } diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index a5ce0cf4714e..ccee13854046 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -257,7 +257,7 @@ void ORelationTableView::AddNewRelation() bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,bool /*_bDelete*/) { - ORelationTableConnectionData* pTabConnData = (ORelationTableConnectionData*)pConn->GetData().get(); + ORelationTableConnectionData* pTabConnData = static_cast<ORelationTableConnectionData*>(pConn->GetData().get()); try { if ( m_bInRemove || pTabConnData->DropRelation()) diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 8dbaf5672843..1536dfe56924 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -504,7 +504,7 @@ void OTableController::impl_initialize() const NamedValueCollection& rArguments( getInitParams() ); - rArguments.get_ensureType( (OUString)PROPERTY_CURRENTTABLE, m_sName ); + rArguments.get_ensureType( OUString(PROPERTY_CURRENTTABLE), m_sName ); // read autoincrement value set in the datasource ::dbaui::fillAutoIncrementValue(getDataSource(),m_bAllowAutoIncrementValue,m_sAutoIncrementValue); |