summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/comboboxtoolbarcontroller.cxx10
-rw-r--r--framework/source/uielement/dropdownboxtoolbarcontroller.cxx10
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;
}