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 /basctl/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 'basctl/source')
-rw-r--r-- | basctl/source/basicide/basicbox.cxx | 18 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 16 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/brkdlg.cxx | 4 |
4 files changed, 20 insertions, 20 deletions
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx index 1c98157d2767..59d438cbb0b4 100644 --- a/basctl/source/basicide/basicbox.cxx +++ b/basctl/source/basicide/basicbox.cxx @@ -209,7 +209,7 @@ void LibBox::FillBox() ClearBox(); // create list box entries - sal_uInt16 nPos = InsertEntry( OUString( IDEResId( RID_STR_ALL ) ), LISTBOX_APPEND ); + sal_Int32 nPos = InsertEntry( OUString( IDEResId( RID_STR_ALL ) ), LISTBOX_APPEND ); SetEntryData( nPos, new LibEntry( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_UNKNOWN, OUString() ) ); InsertEntries( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_USER ); InsertEntries( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_SHARE ); @@ -248,7 +248,7 @@ void LibBox::InsertEntries( const ScriptDocument& rDocument, LibraryLocation eLo { OUString aName( rDocument.getTitle( eLocation ) ); OUString aEntryText( CreateMgrAndLibStr( aName, aLibName ) ); - sal_uInt16 nPos = InsertEntry( aEntryText, LISTBOX_APPEND ); + sal_Int32 nPos = InsertEntry( aEntryText, LISTBOX_APPEND ); SetEntryData( nPos, new LibEntry( rDocument, eLocation, aLibName ) ); } } @@ -312,7 +312,7 @@ void LibBox::Select() void LibBox::NotifyIDE() { - sal_uInt16 nSelPos = GetSelectEntryPos(); + sal_Int32 nSelPos = GetSelectEntryPos(); if (LibEntry* pEntry = static_cast<LibEntry*>(GetEntryData(nSelPos))) { ScriptDocument aDocument( pEntry->GetDocument() ); @@ -330,8 +330,8 @@ void LibBox::NotifyIDE() void LibBox::ClearBox() { - sal_uInt16 nCount = GetEntryCount(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) + sal_Int32 nCount = GetEntryCount(); + for ( sal_Int32 i = 0; i < nCount; ++i ) { LibEntry* pEntry = static_cast<LibEntry*>(GetEntryData( i )); delete pEntry; @@ -411,7 +411,7 @@ void LanguageBox::FillBox() Sequence< Locale > aLocaleSeq = pCurMgr->getStringResourceManager()->getLocales(); const Locale* pLocale = aLocaleSeq.getConstArray(); sal_Int32 i, nCount = aLocaleSeq.getLength(); - sal_uInt16 nSelPos = LISTBOX_ENTRY_NOTFOUND; + sal_Int32 nSelPos = LISTBOX_ENTRY_NOTFOUND; for ( i = 0; i < nCount; ++i ) { bool bIsDefault = localesAreEqual( aDefaultLocale, pLocale[i] ); @@ -423,7 +423,7 @@ void LanguageBox::FillBox() sLanguage += " "; sLanguage += m_sDefaultLanguageStr; } - sal_uInt16 nPos = InsertEntry( sLanguage ); + sal_Int32 nPos = InsertEntry( sLanguage ); SetEntryData( nPos, new LanguageEntry( sLanguage, pLocale[i], bIsDefault ) ); if ( bIsCurrent ) @@ -449,8 +449,8 @@ void LanguageBox::FillBox() void LanguageBox::ClearBox() { - sal_uInt16 nCount = GetEntryCount(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) + sal_Int32 nCount = GetEntryCount(); + for ( sal_Int32 i = 0; i < nCount; ++i ) { LanguageEntry* pEntry = (LanguageEntry*)GetEntryData(i); delete pEntry; diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 233bb6550408..c7e81a11daaf 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1754,7 +1754,7 @@ void WatchWindow::AddWatch( const OUString& rVName ) OUString aWatchStr_( aVar ); aWatchStr_ += "\t\t"; - SvTreeListEntry* pNewEntry = aTreeListBox.InsertEntry( aWatchStr_, 0, true, LIST_APPEND ); + SvTreeListEntry* pNewEntry = aTreeListBox.InsertEntry( aWatchStr_, 0, true, TREELIST_APPEND ); pNewEntry->SetUserData( pWatchItem ); aTreeListBox.Select(pNewEntry, true); @@ -1886,7 +1886,7 @@ StackWindow::StackWindow (Layout* pParent) : aTreeListBox.SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) ); aTreeListBox.SetHighlightRange(); aTreeListBox.SetSelectionMode( NO_SELECTION ); - aTreeListBox.InsertEntry( OUString(), 0, false, LIST_APPEND ); + aTreeListBox.InsertEntry( OUString(), 0, false, TREELIST_APPEND ); aTreeListBox.Show(); SetText(IDEResId(RID_STR_STACKNAME).toString()); @@ -1986,7 +1986,7 @@ void StackWindow::UpdateCalls() } aEntry += ")"; } - aTreeListBox.InsertEntry( aEntry, 0, false, LIST_APPEND ); + aTreeListBox.InsertEntry( aEntry, 0, false, TREELIST_APPEND ); nScope++; pMethod = StarBASIC::GetActiveMethod( nScope ); } @@ -1998,7 +1998,7 @@ void StackWindow::UpdateCalls() else { aTreeListBox.SetSelectionMode( NO_SELECTION ); - aTreeListBox.InsertEntry( OUString(), 0, false, LIST_APPEND ); + aTreeListBox.InsertEntry( OUString(), 0, false, TREELIST_APPEND ); } aTreeListBox.SetUpdateMode(true); @@ -2719,13 +2719,13 @@ void CodeCompleteListBox::KeyInput( const KeyEvent& rKeyEvt ) OUString sTypedText = pCodeCompleteWindow->pParent->GetEditEngine()->GetText(aTextSelection); if( !aFuncBuffer.isEmpty() ) { - sal_uInt16 nInd = GetSelectEntryPos(); + sal_Int32 nInd = GetSelectEntryPos(); if( nInd != LISTBOX_ENTRY_NOTFOUND ) {//if there is something selected bool bFound = false; if( nInd == GetEntryCount() ) nInd = 0; - for( sal_uInt16 i = nInd; i != GetEntryCount(); ++i ) + for( sal_Int32 i = nInd; i != GetEntryCount(); ++i ) { OUString sEntry = (OUString) GetEntry(i); if( sEntry.startsWithIgnoreAsciiCase( aFuncBuffer.toString() ) @@ -2836,14 +2836,14 @@ void CodeCompleteWindow::ResizeAndPositionListBox() aPos.Y() = (aPos.Y() - nViewYOffset) + nBasePad; OUString aLongestEntry = pListBox->GetEntry( 0 );// grab the longest one: max search - for( sal_uInt16 i=1; i< pListBox->GetEntryCount(); ++i ) + for( sal_Int32 i=1; i< pListBox->GetEntryCount(); ++i ) { if( ((OUString) pListBox->GetEntry( i )).getLength() > aLongestEntry.getLength() ) aLongestEntry = pListBox->GetEntry( i ); } // get column/line count const sal_uInt16& nColumns = aLongestEntry.getLength(); - const sal_uInt16& nLines = std::min( (sal_uInt16) 6, pListBox->GetEntryCount() ); + const sal_uInt16 nLines = static_cast<sal_uInt16>( std::min( (sal_Int32) 6, pListBox->GetEntryCount() )); Size aSize = pListBox->CalcBlockSize( nColumns, nLines ); //set the size diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 633962f8e483..8f848a8f390b 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -746,7 +746,7 @@ SvTreeListEntry* TreeListBox::AddEntry( { assert(aUserData != 0); SvTreeListEntry* p = InsertEntry( - rText, rImage, rImage, pParent, bChildrenOnDemand, LIST_APPEND, + rText, rImage, rImage, pParent, bChildrenOnDemand, TREELIST_APPEND, aUserData->get() ); aUserData->release(); diff --git a/basctl/source/basicide/brkdlg.cxx b/basctl/source/basicide/brkdlg.cxx index f41616f51175..77c4c77accc3 100644 --- a/basctl/source/basicide/brkdlg.cxx +++ b/basctl/source/basicide/brkdlg.cxx @@ -154,7 +154,7 @@ IMPL_LINK( BreakPointDialog, ComboBoxHighlightHdl, ComboBox *, pBox ) m_pOKButton->Enable(); m_pDelButton->Enable(); - sal_uInt16 nEntry = pBox->GetEntryPos( pBox->GetText() ); + sal_Int32 nEntry = pBox->GetEntryPos( pBox->GetText() ); BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry ); DBG_ASSERT( pBrk, "Kein passender Breakpoint zur Liste ?" ); UpdateFields( pBrk ); @@ -212,7 +212,7 @@ IMPL_LINK( BreakPointDialog, ButtonHdl, Button *, pButton ) } else if (pButton == m_pDelButton) { - size_t nEntry = m_pComboBox->GetEntryPos( m_pComboBox->GetText() ); + sal_Int32 nEntry = m_pComboBox->GetEntryPos( m_pComboBox->GetText() ); BreakPoint* pBrk = m_aModifiedBreakPointList.at( nEntry ); if ( pBrk ) { |