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 /framework | |
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 'framework')
-rw-r--r-- | framework/source/uielement/comboboxtoolbarcontroller.cxx | 10 | ||||
-rw-r--r-- | framework/source/uielement/dropdownboxtoolbarcontroller.cxx | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index eb80188c2c26..cdc874b87a00 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -306,7 +306,7 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } else if ( rControlCommand.Command == "AddEntry" ) { - sal_uInt16 nPos( COMBOBOX_APPEND ); + sal_Int32 nPos( COMBOBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { @@ -320,7 +320,7 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f } else if ( rControlCommand.Command == "InsertEntry" ) { - sal_uInt16 nPos( COMBOBOX_APPEND ); + sal_Int32 nPos( COMBOBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { @@ -331,7 +331,7 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f { if (( nTmpPos >= 0 ) && ( nTmpPos < sal_Int32( m_pComboBox->GetEntryCount() ))) - nPos = sal_uInt16( nTmpPos ); + nPos = nTmpPos; } } else if ( rControlCommand.Arguments[i].Name == "Text" ) @@ -349,8 +349,8 @@ void ComboboxToolbarController::executeControlCommand( const ::com::sun::star::f sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) { - if ( nPos < sal_Int32( m_pComboBox->GetEntryCount() )) - m_pComboBox->RemoveEntryAt(sal_uInt16(nPos)); + if ( 0 <= nPos && nPos < sal_Int32( m_pComboBox->GetEntryCount() )) + m_pComboBox->RemoveEntryAt(nPos); } break; } diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index 36d30ed28e2b..664b3a7b1570 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -243,7 +243,7 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f } else if ( rControlCommand.Command == "AddEntry" ) { - sal_uInt16 nPos( LISTBOX_APPEND ); + sal_Int32 nPos( LISTBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { @@ -257,7 +257,7 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f } else if ( rControlCommand.Command == "InsertEntry" ) { - sal_uInt16 nPos( LISTBOX_APPEND ); + sal_Int32 nPos( LISTBOX_APPEND ); OUString aText; for ( sal_Int32 i = 0; i < rControlCommand.Arguments.getLength(); i++ ) { @@ -268,7 +268,7 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f { if (( nTmpPos >= 0 ) && ( nTmpPos < sal_Int32( m_pListBoxControl->GetEntryCount() ))) - nPos = sal_uInt16( nTmpPos ); + nPos = nTmpPos; } } else if ( rControlCommand.Arguments[i].Name == "Text" ) @@ -286,8 +286,8 @@ void DropdownToolbarController::executeControlCommand( const ::com::sun::star::f sal_Int32 nPos( -1 ); if ( rControlCommand.Arguments[i].Value >>= nPos ) { - if ( nPos < sal_Int32( m_pListBoxControl->GetEntryCount() )) - m_pListBoxControl->RemoveEntry( sal_uInt16( nPos )); + if ( 0 <= nPos && nPos < sal_Int32( m_pListBoxControl->GetEntryCount() )) + m_pListBoxControl->RemoveEntry( nPos ); } break; } |