diff options
author | Eike Rathke <erack@redhat.com> | 2014-03-01 03:13:28 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-03-05 07:31:19 -0600 |
commit | 68ec95b3f80408ae50897b043eed69a07d084df9 (patch) | |
tree | 5d32076e843fae44f28e3c8d9dbbacf7648fecbc /dbaccess/source | |
parent | c3403ac888c2e62edaf8befe7982f5f8cc95c16f (diff) |
made ListBox handle more than 64k elements, fdo#61520 related
ListBox and related now handle up to sal_Int32 elements correctly.
sal_Int32 instead of sal_Size or size_t because of UNO and a11y API.
Also disentangled some of the mess of SvTreeList and other containers
regarding sal_uInt16, sal_uLong, long, size_t, ... type mixtures.
Change-Id: Idb6e0ae689dc5bc2cf980721972b57b0261e688a
Reviewed-on: https://gerrit.libreoffice.org/8460
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/unodatbr.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/control/FieldDescControl.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/control/opendoccontrols.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/control/tabletree.cxx | 18 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/directsql.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dlgsave.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/indexfieldscontrol.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/paramdialog.cxx | 16 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/paramdialog.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WNameMatch.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 16 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 6 |
14 files changed, 46 insertions, 46 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 273e5530ca5b..de119aab1b82 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -736,7 +736,7 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine Reference<XNameAccess> xSubElements(_xContainer->getByName(*pIter),UNO_QUERY); if ( xSubElements.is() ) { - pEntry = pList->InsertEntry( *pIter, _pParent, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + pEntry = pList->InsertEntry( *pIter, _pParent, sal_False, TREELIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); getBorderWin().getView()->getAppController().containerFound( Reference< XContainer >( xSubElements, UNO_QUERY ) ); fillNames( xSubElements, _eType, _nImageId, pEntry ); } @@ -868,7 +868,7 @@ SvTreeListEntry* OAppDetailPageHelper::elementAdded(ElementType _eType,const OUS if ( xContainer.is() ) { const sal_Int32 nFolderIndicator = lcl_getFolderIndicatorForType( _eType ); - pRet = pTreeView->InsertEntry( _rName, pEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + pRet = pTreeView->InsertEntry( _rName, pEntry, sal_False, TREELIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); fillNames( xContainer, _eType, nImageId, pRet ); } else diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 965ec6e594c4..0a439b14be61 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2088,7 +2088,7 @@ void SbaTableQueryBrowser::implAddDatasource(const OUString& _rDbName, Image& _r m_pTreeView->getListBox().InsertEntry( _rQueryName, _rQueryImage, _rQueryImage, pDatasourceEntry, - sal_True /*ChildrenOnDemand*/, LIST_APPEND, pQueriesData ); + sal_True /*ChildrenOnDemand*/, TREELIST_APPEND, pQueriesData ); } // the child for the tables container @@ -2098,7 +2098,7 @@ void SbaTableQueryBrowser::implAddDatasource(const OUString& _rDbName, Image& _r m_pTreeView->getListBox().InsertEntry( _rTableName, _rTableImage, _rTableImage, pDatasourceEntry, - sal_True /*ChildrenOnDemand*/, LIST_APPEND, pTablesData ); + sal_True /*ChildrenOnDemand*/, TREELIST_APPEND, pTablesData ); } } @@ -2163,7 +2163,7 @@ SvTreeListEntry* SbaTableQueryBrowser::implAppendEntry( SvTreeListEntry* _pParen Image aImage; pImageProvider->getImages( _rName, getDatabaseObjectType( _eEntryType ), aImage ); - SvTreeListEntry* pNewEntry = m_pTreeView->getListBox().InsertEntry( _rName, _pParent, _eEntryType == etQueryContainer , LIST_APPEND, _pUserData ); + SvTreeListEntry* pNewEntry = m_pTreeView->getListBox().InsertEntry( _rName, _pParent, _eEntryType == etQueryContainer , TREELIST_APPEND, _pUserData ); m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImage ); m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImage ); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 0eb4eadb49c0..241d44df6fd9 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -1431,7 +1431,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if(m_pType) { - sal_uInt16 nPos = pFieldType.get() ? m_pType->GetEntryPos(OUString(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; + sal_Int32 nPos = pFieldType.get() ? m_pType->GetEntryPos(OUString(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; if(nPos == LISTBOX_ENTRY_NOTFOUND) { const OTypeInfoMap* pMap = getTypeInfo(); diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 6ec27a9266a0..080aaa4cbe0b 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -240,7 +240,7 @@ namespace dbaui OUString sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); - sal_uInt16 nPos = InsertEntry( sTitle ); + sal_Int32 nPos = InsertEntry( sTitle ); m_aURLs.insert( MapIndexToStringPair::value_type( nPos, StringPair( sDecodedURL, sFilter ) ) ); } } @@ -254,7 +254,7 @@ namespace dbaui OUString OpenDocumentListBox::GetSelectedDocumentURL() const { OUString sURL; - sal_uInt16 nSelected = GetSelectEntryPos(); + sal_Int32 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sURL = impl_getDocumentAtIndex( nSelected ).first; return sURL; @@ -263,7 +263,7 @@ namespace dbaui OUString OpenDocumentListBox::GetSelectedDocumentFilter() const { OUString sFilter; - sal_uInt16 nSelected = GetSelectEntryPos(); + sal_Int32 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sFilter = impl_getDocumentAtIndex( nSelected ).second; return sFilter; @@ -295,7 +295,7 @@ namespace dbaui return; Point aRequestPos( ScreenToOutputPixel( _rHEvt.GetMousePosPixel() ) ); - sal_uInt16 nItemIndex = LISTBOX_ENTRY_NOTFOUND; + sal_Int32 nItemIndex = LISTBOX_ENTRY_NOTFOUND; if ( GetIndexForPoint( aRequestPos, nItemIndex ) != -1 ) { Rectangle aItemRect( GetBoundingRectangle( nItemIndex ) ); diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 81965a4e7608..1aef2959c7a0 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -108,8 +108,8 @@ void OTableTreeListBox::notifyHiContrastChanged() SvTreeListEntry* pEntryLoop = First(); while (pEntryLoop) { - sal_uInt16 nCount = pEntryLoop->ItemCount(); - for (sal_uInt16 i=0;i<nCount;++i) + size_t nCount = pEntryLoop->ItemCount(); + for (size_t i=0;i<nCount;++i) { SvLBoxItem* pItem = pEntryLoop->GetItem(i); if (pItem && pItem->GetType() == SV_ITEM_ID_LBOXCONTEXTBMP) @@ -271,7 +271,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn sRootEntryText = ModuleRes(STR_ALL_VIEWS); else sRootEntryText = ModuleRes(STR_ALL_TABLES_AND_VIEWS); - InsertEntry( sRootEntryText, NULL, sal_False, LIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); + InsertEntry( sRootEntryText, NULL, sal_False, TREELIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); } if ( _rTables.empty() ) @@ -317,7 +317,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn { SvTreeListEntry* pFolder = GetEntryPosByName( *folder, pRootEntry ); if ( !pFolder ) - pFolder = InsertEntry( *folder, pRootEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderType ) ); + pFolder = InsertEntry( *folder, pRootEntry, sal_False, TREELIST_APPEND, reinterpret_cast< void* >( nFolderType ) ); } } } @@ -408,8 +408,8 @@ void OTableTreeListBox::InitEntry(SvTreeListEntry* _pEntry, const OUString& _rSt // replace the text item with our own one SvLBoxItem* pTextItem = _pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING); OSL_ENSURE(pTextItem, "OTableTreeListBox::InitEntry: no text item!?"); - sal_uInt16 nTextPos = _pEntry->GetPos(pTextItem); - OSL_ENSURE(((sal_uInt16)-1) != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); + size_t nTextPos = _pEntry->GetPos(pTextItem); + OSL_ENSURE(SvTreeListEntry::ITEM_NOT_FOUND != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); _pEntry->ReplaceItem(new OBoldListboxString(_pEntry, 0, _rString), nTextPos); } @@ -448,7 +448,7 @@ SvTreeListEntry* OTableTreeListBox::implAddEntry( { SvTreeListEntry* pFolder = GetEntryPosByName( rFirstName, pParentEntry ); if ( !pFolder ) - pFolder = InsertEntry( rFirstName, pParentEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFirstFolderType ) ); + pFolder = InsertEntry( rFirstName, pParentEntry, sal_False, TREELIST_APPEND, reinterpret_cast< void* >( nFirstFolderType ) ); pParentEntry = pFolder; } @@ -456,14 +456,14 @@ SvTreeListEntry* OTableTreeListBox::implAddEntry( { SvTreeListEntry* pFolder = GetEntryPosByName( rSecondName, pParentEntry ); if ( !pFolder ) - pFolder = InsertEntry( rSecondName, pParentEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nSecondFolderType ) ); + pFolder = InsertEntry( rSecondName, pParentEntry, sal_False, TREELIST_APPEND, reinterpret_cast< void* >( nSecondFolderType ) ); pParentEntry = pFolder; } SvTreeListEntry* pRet = NULL; if ( !_bCheckName || !GetEntryPosByName( sName, pParentEntry ) ) { - pRet = InsertEntry( sName, pParentEntry, sal_False, LIST_APPEND ); + pRet = InsertEntry( sName, pParentEntry, sal_False, TREELIST_APPEND ); Image aImage; m_xImageProvider->getImages( _rTableName, DatabaseObject::TABLE, aImage ); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index 1d014a78dfe3..8edd41944493 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -451,7 +451,7 @@ namespace dbaui OUString OTextConnectionHelper::GetSeparator( const ComboBox& rBox, const OUString& rList ) { sal_Unicode nTok = '\t'; - sal_uInt16 nPos(rBox.GetEntryPos( rBox.GetText() )); + sal_Int32 nPos(rBox.GetEntryPos( rBox.GetText() )); if( nPos == COMBOBOX_ENTRY_NOTFOUND ) return rBox.GetText().copy(0); diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index ceabc44dab44..3928566de3fc 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -152,7 +152,7 @@ namespace dbaui if (!m_pSQLHistory) return "invalid listbox!"; - if (m_aStatementHistory.size() != m_pSQLHistory->GetEntryCount()) + if (m_aStatementHistory.size() != static_cast<size_t>(m_pSQLHistory->GetEntryCount())) return "invalid listbox entry count!"; if (!m_xConnection.is()) @@ -318,7 +318,7 @@ namespace dbaui { if (!m_pSQLHistory->IsTravelSelect()) { - const sal_uInt16 nSelected = m_pSQLHistory->GetSelectEntryPos(); + const sal_Int32 nSelected = m_pSQLHistory->GetSelectEntryPos(); if (LISTBOX_ENTRY_NOTFOUND != nSelected) switchToHistory(nSelected, sal_False); } diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index 0f217d4c7a33..f67d2b6f4ab6 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -163,7 +163,7 @@ namespace _rList.InsertEntry( sValue ); } - sal_uInt16 nPos = _rList.GetEntryPos( OUString( _rCurrent ) ); + sal_Int32 nPos = _rList.GetEntryPos( OUString( _rCurrent ) ); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) _rList.SelectEntryPos( nPos ); else @@ -232,7 +232,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, sTable, ::dbtools::eInDataManipulation); - sal_uInt16 nPos = m_pImpl->m_pCatalog->GetEntryPos(OUString(sCatalog)); + sal_Int32 nPos = m_pImpl->m_pCatalog->GetEntryPos(OUString(sCatalog)); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) m_pImpl->m_pCatalog->SelectEntryPos(nPos); diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index e72494df1a50..81ab05eca45e 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -355,7 +355,7 @@ namespace dbaui { OSL_ENSURE(!isNewField(), "IndexFieldsControl::SaveModified: why the hell ...!!!"); // selected entry - sal_uInt16 nPos = m_pSortingCell->GetSelectEntryPos(); + sal_Int32 nPos = m_pSortingCell->GetSelectEntryPos(); OSL_ENSURE(LISTBOX_ENTRY_NOTFOUND != nPos, "IndexFieldsControl::SaveModified: how did you get this selection??"); // adjust the sort flag in the index field description OIndexField& rCurrentField = m_aFields[GetCurRow()]; diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 3a3c08d32e80..417c07d98851 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -263,12 +263,12 @@ namespace dbaui } else if (&m_aTravelNext == pButton) { - sal_uInt16 nCurrent = m_aAllParams.GetSelectEntryPos(); - sal_uInt16 nCount = m_aAllParams.GetEntryCount(); - OSL_ENSURE(nCount == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); + sal_Int32 nCurrent = m_aAllParams.GetSelectEntryPos(); + sal_Int32 nCount = m_aAllParams.GetEntryCount(); + OSL_ENSURE(static_cast<size_t>(nCount) == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); // search the next entry in list we haven't visited yet - sal_uInt16 nNext = (nCurrent + 1) % nCount; + sal_Int32 nNext = (nCurrent + 1) % nCount; while ((nNext != nCurrent) && ( m_aVisitedParams[nNext] & EF_VISITED )) nNext = (nNext + 1) % nCount; @@ -308,14 +308,14 @@ namespace dbaui } // initialize the controls with the new values - sal_uInt16 nSelected = m_aAllParams.GetSelectEntryPos(); + sal_Int32 nSelected = m_aAllParams.GetSelectEntryPos(); OSL_ENSURE(nSelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnEntrySelected : no current entry !"); m_aParam.SetText(::comphelper::getString(m_aFinalValues[nSelected].Value)); m_nCurrentlySelected = nSelected; // with this the value isn't dirty - OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); + OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; m_aResetVisitFlag.SetTimeout(1000); @@ -329,7 +329,7 @@ namespace dbaui OSL_ENSURE(m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnVisitedTimeout : invalid call !"); // mark the currently selected entry as visited - OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); + OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_VISITED; // was it the last "not visited yet" entry ? @@ -375,7 +375,7 @@ namespace dbaui IMPL_LINK(OParameterDialog, OnValueModified, Control*, /*pBox*/) { // mark the currently selected entry as dirty - OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); + OSL_ENSURE(static_cast<size_t>(m_nCurrentlySelected) < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_DIRTY; m_bNeedErrorOnCurrent = sal_True; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index c5de4a17f128..afa0dda5bbed 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -60,7 +60,7 @@ namespace dbaui OKButton m_aOKBtn; CancelButton m_aCancelBtn; - sal_uInt16 m_nCurrentlySelected; + sal_Int32 m_nCurrentlySelected; ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xParams; diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 687f67b358c5..3f11d2b4488a 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -380,7 +380,7 @@ void OColumnTreeBox::FillListBox( const ODatabaseExport::TColumnVector& _rList) ODatabaseExport::TColumnVector::const_iterator aEnd = _rList.end(); for(;aIter != aEnd;++aIter) { - SvTreeListEntry* pEntry = InsertEntry((*aIter)->first,0,sal_False,LIST_APPEND,(*aIter)->second); + SvTreeListEntry* pEntry = InsertEntry((*aIter)->first,0,sal_False,TREELIST_APPEND,(*aIter)->second); SvButtonState eState = !(m_bReadOnly && (*aIter)->second->IsAutoIncrement()) ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED; SetCheckButtonState( pEntry, eState ); } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 8f8039056f0b..2291b683d057 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -947,7 +947,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() if ( !m_bInUndoMode ) rController.GetUndoManager().EnterListAction(OUString(),OUString()); - sal_uInt16 nPos = m_pFieldCell->GetEntryPos(aFieldName); + sal_Int32 nPos = m_pFieldCell->GetEntryPos(aFieldName); OUString aAliasName = pEntry->GetAlias(); if ( nPos != COMBOBOX_ENTRY_NOTFOUND && aAliasName.isEmpty() && comphelper::string::getTokenCount(aFieldName, '.') > 1 ) { // special case, we have a table field so we must cut the table name @@ -1019,8 +1019,8 @@ sal_Bool OSelectionBrowseBox::SaveModified() case BROW_ORDER_ROW: { strOldCellContents = OUString::number((sal_uInt16)pEntry->GetOrderDir()); - sal_uInt16 nIdx = m_pOrderCell->GetSelectEntryPos(); - if (nIdx == sal_uInt16(-1)) + sal_Int32 nIdx = m_pOrderCell->GetSelectEntryPos(); + if (nIdx == LISTBOX_ENTRY_NOTFOUND) nIdx = 0; pEntry->SetOrderDir(EOrderDir(nIdx)); if(!m_bOrderByUnRelated) @@ -1040,7 +1040,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() case BROW_FUNCTION_ROW: { strOldCellContents = pEntry->GetFunction(); - sal_uInt16 nPos = m_pFunctionCell->GetSelectEntryPos(); + sal_Int32 nPos = m_pFunctionCell->GetSelectEntryPos(); // these functions are only available in CORE OUString sFunctionName = m_pFunctionCell->GetEntry(nPos); OUString sGroupFunctionName = m_aFunctionStrings.getToken(comphelper::string::getTokenCount(m_aFunctionStrings, ';')-1, ';'); @@ -1887,9 +1887,9 @@ void OSelectionBrowseBox::CellModified() { OTableFieldDescRef pEntry = getEntry(GetColumnPos(GetCurColumnId()) - 1); - sal_uInt16 nIdx = m_pOrderCell->GetSelectEntryPos(); + sal_Int32 nIdx = m_pOrderCell->GetSelectEntryPos(); if(!m_bOrderByUnRelated && nIdx > 0 && - nIdx != sal_uInt16(-1) && + nIdx != LISTBOX_ENTRY_NOTFOUND && !pEntry->IsEmpty() && pEntry->GetOrderDir() != ORDER_NONE) { @@ -2251,8 +2251,8 @@ OUString OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 n return pEntry->IsVisible() ? g_strOne : g_strZero; case BROW_ORDER_ROW: { - sal_uInt16 nIdx = m_pOrderCell->GetSelectEntryPos(); - if (nIdx == sal_uInt16(-1)) + sal_Int32 nIdx = m_pOrderCell->GetSelectEntryPos(); + if (nIdx == LISTBOX_ENTRY_NOTFOUND) nIdx = 0; return OUString(nIdx); } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index f0b549243c46..9d7ac5ce5d1e 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -708,7 +708,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) void OTableEditorCtrl::resetType() { - sal_uInt16 nPos = pTypeCell->GetSelectEntryPos(); + sal_Int32 nPos = pTypeCell->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) SwitchType( GetView()->getController().getTypeInfo(nPos) ); else @@ -1643,13 +1643,13 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) pRow->SetFieldType( _pType, sal_True ); if ( _pType.get() ) { - const sal_uInt16 nCurrentlySelected = pTypeCell->GetSelectEntryPos(); + const sal_Int32 nCurrentlySelected = pTypeCell->GetSelectEntryPos(); if ( ( LISTBOX_ENTRY_NOTFOUND == nCurrentlySelected ) || ( GetView()->getController().getTypeInfo( nCurrentlySelected ) != _pType ) ) { - sal_uInt16 nEntryPos = 0; + sal_Int32 nEntryPos = 0; const OTypeInfoMap* pTypeInfo = GetView()->getController().getTypeInfo(); OTypeInfoMap::const_iterator aIter = pTypeInfo->begin(); OTypeInfoMap::const_iterator aEnd = pTypeInfo->end(); |