diff options
Diffstat (limited to 'fpicker/source/win32/filepicker/FilterContainer.cxx')
-rw-r--r-- | fpicker/source/win32/filepicker/FilterContainer.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index c23c2443f4ee..f428e45e390b 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -33,14 +33,14 @@ CFilterContainer::CFilterContainer( sal_Int32 initSize ) : m_vFilters( initSize ), - m_bIterInitialized( sal_False ) + m_bIterInitialized( false ) { } // add a name/filter pair -sal_Bool SAL_CALL CFilterContainer::addFilter( - const OUString& aName, const OUString& aFilter, sal_Bool bAllowDuplicates ) +bool SAL_CALL CFilterContainer::addFilter( + const OUString& aName, const OUString& aFilter, bool bAllowDuplicates ) { // check if the filter is already in the container sal_Int32 pos = -1; @@ -51,23 +51,23 @@ sal_Bool SAL_CALL CFilterContainer::addFilter( if ( pos < 0 ) // if not there, append { m_vFilters.push_back( std::make_pair( aName, aFilter ) ); - m_bIterInitialized = sal_False; + m_bIterInitialized = false; } } else { m_vFilters.push_back( std::make_pair( aName, aFilter ) ); - m_bIterInitialized = sal_False; + m_bIterInitialized = false; } - return ( pos < 0 ) ? sal_True : sal_False; + return pos < 0; } // delete a filter // Precondition: the container is not empty // there is a filter identified by the given name -sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) +bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) { OSL_ASSERT( !m_vFilters.empty() ); @@ -75,10 +75,10 @@ sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) if ( pos > -1 ) { m_vFilters.erase( ( m_vFilters.begin() + pos ) ); - m_bIterInitialized = sal_False; + m_bIterInitialized = false; } - return ( pos > -1 ) ? sal_True : sal_False; + return pos > -1; } // return the number of filters currently in the container @@ -99,7 +99,7 @@ void SAL_CALL CFilterContainer::empty() // Precondition: the container is not empty // there is a filter identified by the name -sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const +bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const { OSL_PRECOND( !m_vFilters.empty() , "Empty filter container" ); @@ -116,12 +116,12 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& pos = -1; } - return (pos > -1 ) ? sal_True : sal_False; + return pos > -1; } -sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const +bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const { - sal_Bool bRet = sal_True; + bool bRet = true; try { @@ -130,7 +130,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi catch( std::out_of_range& ) { OSL_FAIL( "Filter index out of range" ); - bRet = sal_False; + bRet = false; } return bRet; @@ -164,21 +164,21 @@ sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) co void SAL_CALL CFilterContainer::beginEnumFilter( ) { m_iter = m_vFilters.begin( ); - m_bIterInitialized = sal_True; + m_bIterInitialized = true; } // returns true if another filter has been retrieved -sal_Bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEntry ) +bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEntry ) { OSL_ASSERT( m_bIterInitialized ); - sal_Bool bRet = ( m_iter != m_vFilters.end( ) ); + bool bRet = ( m_iter != m_vFilters.end( ) ); if ( bRet ) nextFilterEntry = *m_iter++; else - m_bIterInitialized = sal_False; + m_bIterInitialized = false; return bRet; } @@ -197,7 +197,7 @@ OUString SAL_CALL CFilterContainer::getCurrentFilter() const // length of the name + '\0' + length of the filter string + // a trailing '\0' -static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) +static sal_uInt32 getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) { return ( aFilterEntry.first.getLength( ) + 1 + @@ -206,7 +206,7 @@ static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntr // calculates the length of all filters currently in the container -static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) +static sal_uInt32 getTotalFilterLength( CFilterContainer& aFilterContainer ) { CFilterContainer::FILTER_ENTRY_T nextFilter; @@ -214,13 +214,13 @@ static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) sal_uInt32 totalLength = 0; while( aFilterContainer.getNextFilter( nextFilter ) ) - totalLength += _getLengthFilter( nextFilter ); + totalLength += getLengthFilter( nextFilter ); return ( totalLength > 0 ) ? totalLength + 1 : totalLength; } inline -void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) +void wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) { memcpy( pDest, pSrc, nLength * sizeof( sal_Unicode ) ); } @@ -232,7 +232,7 @@ void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) { // calculate the required buffer size - sal_uInt32 reqBuffSize = _getTotalFilterLength( aFilterContainer ); + sal_uInt32 reqBuffSize = getTotalFilterLength( aFilterContainer ); // return if there are no filters if ( !reqBuffSize ) @@ -251,14 +251,14 @@ OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) while( aFilterContainer.getNextFilter( nextFilter ) ) { - _wcsmemcpy( + wcsmemcpy( pBuff + memPos, nextFilter.first.getStr( ), nextFilter.first.getLength( ) ); memPos += nextFilter.first.getLength( ) + 1; - _wcsmemcpy( + wcsmemcpy( pBuff + memPos, nextFilter.second.getStr( ), nextFilter.second.getLength( ) ); |