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 /sd/source/ui/dlg | |
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 'sd/source/ui/dlg')
-rw-r--r-- | sd/source/ui/dlg/animobjs.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/dlg/copydlg.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/custsdlg.cxx | 20 | ||||
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/present.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpaction.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 8 |
8 files changed, 35 insertions, 35 deletions
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 2651d367deb0..59cc9bbbac90 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -916,9 +916,9 @@ void AnimationWindow::AddObj (::sd::View& rView ) // several objects SdrObjList* pObjList = ((SdrObjGroup*)pObject)->GetSubList(); - for( sal_uInt16 nObject = 0; nObject < pObjList->GetObjCount(); nObject++ ) + for( sal_uLong nObject = 0; nObject < pObjList->GetObjCount(); nObject++ ) { - SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( (sal_uLong) nObject ); + SdrObject* pSnapShot = (SdrObject*) pObjList->GetObj( nObject ); BitmapEx *const pBitmapEx = new BitmapEx( SdrExchangeView::GetObjGraphic( @@ -994,7 +994,7 @@ void AnimationWindow::AddObj (::sd::View& rView ) SdrObjList* pObjList = pCloneGroup->GetSubList(); for (sal_uLong nObject= 0; nObject < nMarkCount; nObject++) - pObjList->InsertObject(rMarkList.GetMark(nObject)->GetMarkedSdrObj()->Clone(), LIST_APPEND); + pObjList->InsertObject(rMarkList.GetMark(nObject)->GetMarkedSdrObj()->Clone(), CONTAINER_APPEND); pPage->InsertObject(pCloneGroup, m_nCurrentFrame + 1); } @@ -1122,7 +1122,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) // find LoopCount (number of passes) AnimationBitmap aAnimBmp; long nLoopCount = 0L; - sal_uInt16 nPos = aLbLoopCount.GetSelectEntryPos(); + sal_Int32 nPos = aLbLoopCount.GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND && nPos != aLbLoopCount.GetEntryCount() - 1 ) // endless nLoopCount = (long) aLbLoopCount.GetSelectEntry().toInt32(); @@ -1222,7 +1222,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView ) pClone = pPage->GetObj(i); SdrObject* pCloneOfClone = pClone->Clone(); //SdrObject* pCloneOfClone = pPage->GetObj(i)->Clone(); - pObjList->InsertObject(pCloneOfClone, LIST_APPEND); + pObjList->InsertObject(pCloneOfClone, CONTAINER_APPEND); } // until now the top left corner of the group is in the window center; diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index 5a76931d2fdd..f6d223d992b1 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -233,7 +233,7 @@ void CopyDlg::GetAttr( SfxItemSet& rOutAttrs ) */ IMPL_LINK_NOARG(CopyDlg, SelectColorHdl) { - sal_uInt16 nPos = m_pLbStartColor->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbStartColor->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND && !m_pLbEndColor->IsEnabled() ) diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 8c7f54da43b2..1561111ab371 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -74,7 +74,7 @@ SdCustomShowDlg::SdCustomShowDlg( Window* pWindow, { m_pLbCustomShows->InsertEntry( pCustomShow->GetName() ); } - m_pLbCustomShows->SelectEntryPos( (sal_uInt16)nPosToSelect ); + m_pLbCustomShows->SelectEntryPos( (sal_Int32)nPosToSelect ); pCustomShowList->Seek( nPosToSelect ); } @@ -89,7 +89,7 @@ SdCustomShowDlg::~SdCustomShowDlg() void SdCustomShowDlg::CheckState() { - sal_uInt16 nPos = m_pLbCustomShows->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbCustomShows->GetSelectEntryPos(); sal_Bool bEnable = nPos != LISTBOX_ENTRY_NOTFOUND; m_pBtnEdit->Enable( bEnable ); @@ -134,7 +134,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) // edit CustomShow else if( p == m_pBtnEdit ) { - sal_uInt16 nPos = m_pLbCustomShows->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbCustomShows->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { DBG_ASSERT( pCustomShowList, "pCustomShowList does not exist" ); @@ -159,7 +159,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) // delete CustomShow else if( p == m_pBtnRemove ) { - sal_uInt16 nPos = m_pLbCustomShows->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbCustomShows->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { delete (*pCustomShowList)[nPos]; @@ -172,7 +172,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) // copy CustomShow else if( p == m_pBtnCopy ) { - sal_uInt16 nPos = m_pLbCustomShows->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbCustomShows->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { SdCustomShow* pShow = new SdCustomShow( *(*pCustomShowList)[nPos] ); @@ -231,7 +231,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p ) } else if( p == m_pLbCustomShows ) { - sal_uInt16 nPos = m_pLbCustomShows->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbCustomShows->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) pCustomShowList->Seek( nPos ); @@ -358,15 +358,15 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p ) { if( p == m_pBtnAdd ) { - sal_uInt16 nCount = m_pLbPages->GetSelectEntryCount(); + sal_Int32 nCount = m_pLbPages->GetSelectEntryCount(); if( nCount > 0 ) { - sal_uLong nPosCP = LIST_APPEND; + sal_uLong nPosCP = TREELIST_APPEND; SvTreeListEntry* pEntry = m_pLbCustomPages->FirstSelected(); if( pEntry ) nPosCP = m_pLbCustomPages->GetModel()->GetAbsPos( pEntry ) + 1L; - for( sal_uInt16 i = 0; i < nCount; i++ ) + for( sal_Int32 i = 0; i < nCount; i++ ) { OUString aStr = m_pLbPages->GetSelectEntry( i ); pEntry = m_pLbCustomPages->InsertEntry( aStr, @@ -377,7 +377,7 @@ IMPL_LINK( SdDefineCustomShowDlg, ClickButtonHdl, void *, p ) GetSelectEntryPos( i ), PK_STANDARD ); pEntry->SetUserData( pPage ); - if( nPosCP != LIST_APPEND ) + if( nPosCP != TREELIST_APPEND ) nPosCP++; } bModified = sal_True; diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index 66a3ca0aa9f9..9753e01823f2 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -679,7 +679,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) void SdNavigatorWin::RefreshDocumentLB( const OUString* pDocName ) { - sal_uInt16 nPos = 0; + sal_Int32 nPos = 0; if( pDocName ) { diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index b7c14fefc02d..7d1f022f8760 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -250,7 +250,7 @@ void SdStartPresentationDlg::InitMonitorSettings() nSelectedIndex = nDefaultExternalIndex; } - maLBMonitor->SelectEntryPos((sal_uInt16)nSelectedIndex); + maLBMonitor->SelectEntryPos(nSelectedIndex); } } catch( Exception& ) @@ -278,7 +278,7 @@ void SdStartPresentationDlg::GetAttr( SfxItemSet& rAttr ) rAttr.Put( SfxUInt32Item ( ATTR_PRESENT_PAUSE_TIMEOUT, aTmfPause->GetTime().GetMSFromTime() / 1000 ) ); rAttr.Put( SfxBoolItem ( ATTR_PRESENT_SHOW_PAUSELOGO, aCbxAutoLogo->IsChecked() ) ); - sal_uInt16 nPos = maLBMonitor->GetSelectEntryPos(); + sal_Int32 nPos = maLBMonitor->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) rAttr.Put( SfxInt32Item ( ATTR_PRESENT_DISPLAY, (sal_Int32)(sal_IntPtr)maLBMonitor->GetEntryData(nPos)) ); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 82401f1b17b1..70a521c05323 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -593,7 +593,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium, Image aImgDocClosed=Image( BitmapEx( SdResId( BMP_DOC_CLOSED ) ) ); // insert document name - InsertEntry( maDocName, aImgDocOpen, aImgDocClosed, NULL, sal_True, LIST_APPEND, + InsertEntry( maDocName, aImgDocOpen, aImgDocClosed, NULL, sal_True, TREELIST_APPEND, reinterpret_cast< void* >( 1 ) ); } @@ -625,7 +625,7 @@ void SdPageObjsTLB::AddShapeList ( aIcon, pParentEntry, sal_False, - LIST_APPEND, + TREELIST_APPEND, pUserData); SdrObjListIter aIter( @@ -674,7 +674,7 @@ void SdPageObjsTLB::AddShapeList ( maImgOle, pEntry, sal_False, - LIST_APPEND, + TREELIST_APPEND, pObj ); @@ -708,7 +708,7 @@ void SdPageObjsTLB::AddShapeList ( maImgGraphic, pEntry, sal_False, - LIST_APPEND, + TREELIST_APPEND, pObj ); @@ -757,7 +757,7 @@ void SdPageObjsTLB::AddShapeList ( rIconProvider.maImgObjects, pEntry, sal_False, - LIST_APPEND, + TREELIST_APPEND, pObj ); @@ -973,7 +973,7 @@ void SdPageObjsTLB::RequestingChildren( SvTreeListEntry* pFileEntry ) aImgPage, pFileEntry, sal_False, - LIST_APPEND, + TREELIST_APPEND, reinterpret_cast< void* >( 1 ) ); SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS ); @@ -1445,8 +1445,8 @@ bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const if (pCustomShow != NULL) { bBelongsToShow = false; - sal_uLong nPageCount = pCustomShow->PagesVector().size(); - for (sal_uInt16 i=0; i<nPageCount && !bBelongsToShow; i++) + size_t nPageCount = pCustomShow->PagesVector().size(); + for (size_t i=0; i<nPageCount && !bBelongsToShow; i++) if (pPage == pCustomShow->PagesVector()[i]) bBelongsToShow = true; } diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx index 602fc58b7e6a..b52a0c0dcb56 100644 --- a/sd/source/ui/dlg/tpaction.cxx +++ b/sd/source/ui/dlg/tpaction.cxx @@ -723,9 +723,9 @@ IMPL_LINK_NOARG(SdTPAction, CheckFileHdl) presentation::ClickAction SdTPAction::GetActualClickAction() { presentation::ClickAction eCA = presentation::ClickAction_NONE; - sal_uInt16 nPos = m_pLbAction->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbAction->GetSelectEntryPos(); - if (nPos != LISTBOX_ENTRY_NOTFOUND && nPos < maCurrentActions.size()) + if (nPos != LISTBOX_ENTRY_NOTFOUND && static_cast<size_t>(nPos) < maCurrentActions.size()) eCA = maCurrentActions[ nPos ]; return( eCA ); } @@ -818,8 +818,8 @@ OUString SdTPAction::GetEditText( sal_Bool bFullDocDestination ) break; case presentation::ClickAction_VERB: { - const sal_uInt16 nPos = m_pLbOLEAction->GetSelectEntryPos(); - if( nPos < aVerbVector.size() ) + const sal_Int32 nPos = m_pLbOLEAction->GetSelectEntryPos(); + if( static_cast<size_t>(nPos) < aVerbVector.size() ) aStr = OUString::number( aVerbVector[ nPos ] ); return aStr; } diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index afd3547087a3..43809ecc6f9d 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -254,7 +254,7 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs ) { OUString sMetric = aMetricArr.GetStringByPos( i ); sal_IntPtr nFieldUnit = aMetricArr.GetValue( i ); - sal_uInt16 nPos = m_pLbMetric->InsertEntry( sMetric ); + sal_Int32 nPos = m_pLbMetric->InsertEntry( sMetric ); m_pLbMetric->SetEntryData( nPos, (void*)nFieldUnit ); } m_pLbMetric->SetSelectHdl( LINK( this, SdTpOptionsMisc, SelectMetricHdl_Impl ) ); @@ -401,7 +401,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs ) } // metric - const sal_uInt16 nMPos = m_pLbMetric->GetSelectEntryPos(); + const sal_Int32 nMPos = m_pLbMetric->GetSelectEntryPos(); if ( nMPos != m_pLbMetric->GetSavedValue() ) { sal_uInt16 nFieldUnit = (sal_uInt16)(sal_IntPtr)m_pLbMetric->GetEntryData( nMPos ); @@ -470,7 +470,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs ) const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich ); long nFieldUnit = (long)rItem.GetValue(); - for ( sal_uInt16 i = 0; i < m_pLbMetric->GetEntryCount(); ++i ) + for ( sal_Int32 i = 0; i < m_pLbMetric->GetEntryCount(); ++i ) { if ( (sal_IntPtr)m_pLbMetric->GetEntryData( i ) == nFieldUnit ) { @@ -523,7 +523,7 @@ SfxTabPage* SdTpOptionsMisc::Create( Window* pWindow, IMPL_LINK_NOARG(SdTpOptionsMisc, SelectMetricHdl_Impl) { - sal_uInt16 nPos = m_pLbMetric->GetSelectEntryPos(); + sal_Int32 nPos = m_pLbMetric->GetSelectEntryPos(); if( nPos != LISTBOX_ENTRY_NOTFOUND ) { |