[Libreoffice-commits] core.git: svtools/source

Eike Rathke erack at redhat.com
Wed Mar 5 07:21:51 PST 2014


 svtools/source/control/ctrlbox.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 160d289564428c458f4923fe2eb5bfe28c3c61a7
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Mar 5 16:20:31 2014 +0100

    cast to the higher capacity type instead
    
    Change-Id: I515f315c93dd19016dfdabdf9524606214f84891

diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 5461863..1065b34 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -827,7 +827,7 @@ sal_Int32 LineListBox::InsertEntry( const OUString& rStr, sal_Int32 nPos )
 {
     nPos = ListBox::InsertEntry( rStr, nPos );
     if ( nPos != LISTBOX_ERROR ) {
-        if ( nPos < static_cast<sal_Int32>(pLineList->size()) ) {
+        if ( static_cast<size_t>(nPos) < pLineList->size() ) {
             ImpLineList::iterator it = pLineList->begin();
             ::std::advance( it, nPos );
             pLineList->insert( it, reinterpret_cast<ImpLineListData *>(NULL) );
@@ -855,7 +855,7 @@ void LineListBox::RemoveEntry( sal_Int32 nPos )
 {
     ListBox::RemoveEntry( nPos );
 
-    if ( 0 <= nPos && nPos < static_cast<sal_Int32>(pLineList->size()) ) {
+    if ( 0 <= nPos && static_cast<size_t>(nPos) < pLineList->size() ) {
         ImpLineList::iterator it = pLineList->begin();
         ::std::advance( it, nPos );
         if ( *it ) delete *it;
@@ -901,7 +901,7 @@ sal_Int32 LineListBox::GetEntryPos( sal_uInt16 nStyle ) const
 
 sal_uInt16 LineListBox::GetEntryStyle( sal_Int32 nPos ) const
 {
-    ImpLineListData* pData = (0 <= nPos && nPos < static_cast<sal_Int32>(pLineList->size())) ? (*pLineList)[ nPos ] : NULL;
+    ImpLineListData* pData = (0 <= nPos && static_cast<size_t>(nPos) < pLineList->size()) ? (*pLineList)[ nPos ] : NULL;
     return ( pData ) ? pData->GetStyle() : table::BorderLineStyle::NONE;
 }
 


More information about the Libreoffice-commits mailing list