diff options
Diffstat (limited to 'dbaccess/source/ui/browser/unodatbr.cxx')
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index d994894ace88..fd349e989ffe 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -213,11 +213,11 @@ SbaTableQueryBrowser::SbaTableQueryBrowser(const Reference< XComponentContext >& ,m_aSelectionListeners( getMutex() ) ,m_aContextMenuInterceptors( getMutex() ) ,m_aTableCopyHelper(this) - ,m_pTreeView(NULL) - ,m_pSplitter(NULL) - ,m_pTreeModel(NULL) - ,m_pCurrentlyDisplayed(NULL) - ,m_nAsyncDrop(0) + ,m_pTreeView(nullptr) + ,m_pSplitter(nullptr) + ,m_pTreeModel(nullptr) + ,m_pCurrentlyDisplayed(nullptr) + ,m_nAsyncDrop(nullptr) ,m_nBorder(1) ,m_bQueryEscapeProcessing( false ) ,m_bShowMenu(false) @@ -296,13 +296,13 @@ void SAL_CALL SbaTableQueryBrowser::disposing() // reset the content's tree view: it holds a reference to our model which is to be deleted immediately, // and it will live longer than we do. if (getBrowserView()) - getBrowserView()->setTreeView(NULL); + getBrowserView()->setTreeView(nullptr); clearTreeModel(); // clear the tree model { ::std::unique_ptr<SvTreeList> aTemp(m_pTreeModel); - m_pTreeModel = NULL; + m_pTreeModel = nullptr; } // remove ourself as status listener @@ -1036,20 +1036,20 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv void SbaTableQueryBrowser::checkDocumentDataSource() { - SvTreeListEntry* pDataSourceEntry = NULL; - SvTreeListEntry* pContainerEntry = NULL; + SvTreeListEntry* pDataSourceEntry = nullptr; + SvTreeListEntry* pContainerEntry = nullptr; SvTreeListEntry* pObjectEntry = getObjectEntry( m_aDocumentDataSource, &pDataSourceEntry, &pContainerEntry, false ); - bool bKnownDocDataSource = (NULL != pObjectEntry); + bool bKnownDocDataSource = (nullptr != pObjectEntry); if (!bKnownDocDataSource) { - if (NULL != pDataSourceEntry) + if (nullptr != pDataSourceEntry) { // at least the data source is known - if (NULL != pContainerEntry) + if (nullptr != pContainerEntry) bKnownDocDataSource = true; // assume we know it. // TODO: should we expand the object container? This may be too expensive just for checking .... else { - if ((NULL == pObjectEntry) && m_aDocumentDataSource.has(daCommandType) && m_aDocumentDataSource.has(daCommand)) + if ((nullptr == pObjectEntry) && m_aDocumentDataSource.has(daCommandType) && m_aDocumentDataSource.has(daCommand)) { // maybe we have a command to be displayed ? sal_Int32 nCommandType = CommandType::TABLE; m_aDocumentDataSource[daCommandType] >>= nCommandType; @@ -1132,11 +1132,11 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour const SharedConnection& _rxConnection ) { if (_ppDataSourceEntry) - *_ppDataSourceEntry = NULL; + *_ppDataSourceEntry = nullptr; if (_ppContainerEntry) - *_ppContainerEntry = NULL; + *_ppContainerEntry = nullptr; - SvTreeListEntry* pObject = NULL; + SvTreeListEntry* pObject = nullptr; if ( m_pTreeView ) { // look for the data source entry @@ -1146,7 +1146,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour // #i33699# FilterByEntryDataId aFilter( sDataSourceId ); - SvTreeListEntry* pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); + SvTreeListEntry* pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, nullptr, &aFilter ); if ( !pDataSource ) // check if the data source name is a file location { if ( bIsDataSourceURL ) @@ -1154,7 +1154,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour // special case, the data source is a URL // add new entries to the list box model implAddDatasource( _rDataSource, _rxConnection ); - pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); + pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, nullptr, &aFilter ); OSL_ENSURE( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); } } @@ -1169,7 +1169,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getObjectEntry(const OUString& _rDataSour m_pTreeView->getListBox().Expand(pDataSource); // look for the object container - SvTreeListEntry* pCommandType = NULL; + SvTreeListEntry* pCommandType = nullptr; switch (_nCommandType) { case CommandType::TABLE: @@ -1391,7 +1391,7 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const css::lang::EventObject& _rS { // our connection is in dispose so we have to find the entry equal with this connection // and close it what means to collapse the entry // get the top-level representing the removed data source - SvTreeListEntry* pDSLoop = m_pTreeView->getListBox().FirstChild(NULL); + SvTreeListEntry* pDSLoop = m_pTreeView->getListBox().FirstChild(nullptr); while (pDSLoop) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pDSLoop->GetUserData()); @@ -1694,11 +1694,11 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const DBTreeListUserData* pDSData = pDataSourceEntry ? static_cast< DBTreeListUserData* >( pDataSourceEntry->GetUserData() ) - : NULL; + : nullptr; if ( nId == ID_TREE_CLOSE_CONN ) { - aReturn.bEnabled = ( pDSData != NULL ) && pDSData->xConnection.is(); + aReturn.bEnabled = ( pDSData != nullptr ) && pDSData->xConnection.is(); } else if ( nId == ID_TREE_EDIT_DATABASE ) { @@ -1706,7 +1706,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const "/org.openoffice.Office.DataAccess/Policies/Features/Common" ) ); bool bHaveEditDatabase( true ); OSL_VERIFY( aConfig.getNodeValue( "EditDatabaseFromDataSourceView" ) >>= bHaveEditDatabase ); - aReturn.bEnabled = getORB().is() && ( pDataSourceEntry != NULL ) && bHaveEditDatabase; + aReturn.bEnabled = getORB().is() && ( pDataSourceEntry != nullptr ) && bHaveEditDatabase; } else if ( nId == ID_BROWSER_COPY ) { @@ -1946,7 +1946,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue { // transfer the selected rows only if not all rows are selected // (all rows means the whole table) // #i3832# - if (pSelection != NULL) + if (pSelection != nullptr) { aSelection.realloc(pSelection->GetSelectCount()); long nIdx = pSelection->FirstSelected(); @@ -2452,8 +2452,8 @@ bool SbaTableQueryBrowser::implSelect(const OUString& _rDataSourceName, const OU { if (_rDataSourceName.getLength() && _rCommand.getLength() && (-1 != _nCommandType)) { - SvTreeListEntry* pDataSource = NULL; - SvTreeListEntry* pCommandType = NULL; + SvTreeListEntry* pDataSource = nullptr; + SvTreeListEntry* pCommandType = nullptr; SvTreeListEntry* pCommand = getObjectEntry( _rDataSourceName, _rCommand, _nCommandType, &pDataSource, &pCommandType, true, _rxConnection ); if (pCommand) @@ -2479,7 +2479,7 @@ bool SbaTableQueryBrowser::implSelect(const OUString& _rDataSourceName, const OU if ( m_pCurrentlyDisplayed ) { // tell the old entry (if any) it has been deselected selectPath(m_pCurrentlyDisplayed, false); - m_pCurrentlyDisplayed = NULL; + m_pCurrentlyDisplayed = nullptr; } // we have a command and need to display this in the rowset @@ -2582,7 +2582,7 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) // tell the old entry it has been deselected selectPath(m_pCurrentlyDisplayed, false); - m_pCurrentlyDisplayed = NULL; + m_pCurrentlyDisplayed = nullptr; // not really loaded m_pCurrentlyDisplayed = _pEntry; @@ -2725,8 +2725,8 @@ bool SbaTableQueryBrowser::implSelect( SvTreeListEntry* _pEntry ) SvTreeListEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNameAccess>& _rxNameAccess) { DBTreeListBox& rListBox = m_pTreeView->getListBox(); - SvTreeListEntry* pContainer = NULL; - SvTreeListEntry* pDSLoop = rListBox.FirstChild(NULL); + SvTreeListEntry* pContainer = nullptr; + SvTreeListEntry* pDSLoop = rListBox.FirstChild(nullptr); while (pDSLoop) { pContainer = rListBox.GetEntry(pDSLoop, CONTAINER_QUERIES); @@ -2740,7 +2740,7 @@ SvTreeListEntry* SbaTableQueryBrowser::getEntryFromContainer(const Reference<XNa break; pDSLoop = SvTreeList::NextSibling(pDSLoop); - pContainer = NULL; + pContainer = nullptr; } return pContainer; } @@ -2812,7 +2812,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven unloadAndCleanup( false ); // don't dispose the connection DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pTemp->GetUserData()); - pTemp->SetUserData(NULL); + pTemp->SetUserData(nullptr); delete pData; // the data could be null because we have a table which isn't correct m_pTreeModel->Remove(pTemp); @@ -2826,7 +2826,7 @@ void SAL_CALL SbaTableQueryBrowser::elementRemoved( const ContainerEvent& _rEven if (m_pTreeView->getListBox().GetEntryText(pChild) == aName) { DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pChild->GetUserData()); - pChild->SetUserData(NULL); + pChild->SetUserData(nullptr); delete pData; m_pTreeModel->Remove(pChild); break; @@ -2868,7 +2868,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve } else { - pTemp->SetUserData(NULL); + pTemp->SetUserData(nullptr); delete pData; } } @@ -2890,7 +2890,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve } else { - pChild->SetUserData(NULL); + pChild->SetUserData(nullptr); delete pData; } } @@ -2975,7 +2975,7 @@ void SbaTableQueryBrowser::closeConnection(SvTreeListEntry* _pDSEntry, bool _bDi SvTreeListEntry* pRemove = pElements; pElements = SvTreeList::NextSibling(pElements); DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pRemove->GetUserData()); - pRemove->SetUserData(NULL); + pRemove->SetUserData(nullptr); delete pData; m_pTreeModel->Remove(pRemove); } @@ -3001,7 +3001,7 @@ void SbaTableQueryBrowser::unloadAndCleanup( bool _bDisposeConnection ) { selectPath(m_pCurrentlyDisplayed, false); } - m_pCurrentlyDisplayed = NULL; + m_pCurrentlyDisplayed = nullptr; try { @@ -3287,7 +3287,7 @@ bool SbaTableQueryBrowser::ensureConnection(SvTreeListEntry* _pAnyEntry, SharedC DBTreeListUserData* pDSData = pDSEntry ? static_cast<DBTreeListUserData*>(pDSEntry->GetUserData()) - : NULL; + : nullptr; return ensureConnection( pDSEntry, pDSData, _rConnection ); } @@ -3307,7 +3307,7 @@ bool SbaTableQueryBrowser::getExistentConnectionFor( SvTreeListEntry* _pAnyEntry DBTreeListUserData* pDSData = pDSEntry ? static_cast< DBTreeListUserData* >( pDSEntry->GetUserData() ) - : NULL; + : nullptr; if ( pDSData ) _rConnection = pDSData->xConnection; return _rConnection.is(); @@ -3342,7 +3342,7 @@ bool SbaTableQueryBrowser::ensureConnection( SvTreeListEntry* _pDSEntry, void* p // connect _rConnection.reset( - connect( getDataSourceAcessor( _pDSEntry ), sConnectingContext, NULL ), + connect( getDataSourceAcessor( _pDSEntry ), sConnectingContext, nullptr ), SharedConnection::TakeOwnership ); @@ -3438,13 +3438,13 @@ void SbaTableQueryBrowser::implAdministrate( SvTreeListEntry* _pApplyTo ) if (pTopLevelSelected) sInitialSelection = getDataSourceAcessor( pTopLevelSelected ); - Reference< XDataSource > xDataSource( getDataSourceByName( sInitialSelection, getView(), getORB(), NULL ) ); + Reference< XDataSource > xDataSource( getDataSourceByName( sInitialSelection, getView(), getORB(), nullptr ) ); Reference< XModel > xDocumentModel( getDataSourceOrModel( xDataSource ), UNO_QUERY ); if ( xDocumentModel.is() ) { Reference< XInteractionHandler2 > xInteractionHandler( - InteractionHandler::createWithParent(getORB(), 0) ); + InteractionHandler::createWithParent(getORB(), nullptr) ); ::comphelper::NamedValueCollection aLoadArgs; aLoadArgs.put( "Model", xDocumentModel ); @@ -3484,7 +3484,7 @@ PopupMenu* SbaTableQueryBrowser::getContextMenu( Control& _rControl ) const OSL_PRECOND( &m_pTreeView->getListBox() == &_rControl, "SbaTableQueryBrowser::getContextMenu: where does this come from?" ); if ( &m_pTreeView->getListBox() != &_rControl ) - return NULL; + return nullptr; return new PopupMenu( ModuleRes( MENU_BROWSER_DEFAULTCONTEXT ) ); } @@ -3511,7 +3511,7 @@ Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const if ( !pSelected ) return Any(); - OSL_ENSURE( m_pTreeView->getListBox().NextSelected( pSelected ) == NULL, + OSL_ENSURE( m_pTreeView->getListBox().NextSelected( pSelected ) == nullptr, "SbaTableQueryBrowser::getCurrentSelection: single-selection is expected here!" ); NamedDatabaseObject aSelectedObject; @@ -3679,8 +3679,8 @@ bool SbaTableQueryBrowser::preReloadForm() extractDescriptorProps(aDesc, sDataSource, sCommand, nCommandType, bEscapeProcessing); if ( !sDataSource.isEmpty() && !sCommand.isEmpty() && (-1 != nCommandType) ) { - SvTreeListEntry* pDataSource = NULL; - SvTreeListEntry* pCommandType = NULL; + SvTreeListEntry* pDataSource = nullptr; + SvTreeListEntry* pCommandType = nullptr; m_pCurrentlyDisplayed = getObjectEntry( sDataSource, sCommand, nCommandType, &pDataSource, &pCommandType, true, SharedConnection() ); bIni = true; } @@ -3740,7 +3740,7 @@ void SAL_CALL SbaTableQueryBrowser::registeredDatabaseLocation( const DatabaseRe void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const OUString& _rDataSourceName ) { // get the top-level representing the removed data source - SvTreeListEntry* pDataSourceEntry = m_pTreeView->getListBox().FirstChild( NULL ); + SvTreeListEntry* pDataSourceEntry = m_pTreeView->getListBox().FirstChild( nullptr ); while ( pDataSourceEntry ) { if ( m_pTreeView->getListBox().GetEntryText( pDataSourceEntry ) == _rDataSourceName ) @@ -3761,7 +3761,7 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const OUString& _rDataSo } else OSL_ENSURE( - ( NULL == m_pCurrentlyDisplayed ) + ( nullptr == m_pCurrentlyDisplayed ) || ( m_pTreeView->getListBox().GetRootLevelParent( m_pCurrentlyDisplayed ) != pDataSourceEntry ), "SbaTableQueryBrowser::impl_cleanupDataSourceEntry: inconsistence (2)!"); @@ -3775,13 +3775,13 @@ void SbaTableQueryBrowser::impl_cleanupDataSourceEntry( const OUString& _rDataSo { SvTreeListEntry* pEntry = (*it).get(); const DBTreeListUserData* pData = static_cast<const DBTreeListUserData*>(pEntry->GetUserData()); - pEntry->SetUserData(NULL); + pEntry->SetUserData(nullptr); delete pData; } // remove the entry DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( pDataSourceEntry->GetUserData() ); - pDataSourceEntry->SetUserData( NULL ); + pDataSourceEntry->SetUserData( nullptr ); delete pData; m_pTreeModel->Remove( pDataSourceEntry ); } |