diff options
Diffstat (limited to 'fpicker/source/win32/filepicker/FilterContainer.cxx')
-rw-r--r-- | fpicker/source/win32/filepicker/FilterContainer.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index d2de0ac6d74b..2c609c4f9414 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ using ::rtl::OUString; // ctor //------------------------------------------------------------------------------------- -CFilterContainer::CFilterContainer( sal_Int32 initSize ) : +CFilterContainer::CFilterContainer( sal_Int32 initSize ) : m_vFilters( initSize ), m_bIterInitialized( sal_False ) { @@ -64,12 +64,12 @@ CFilterContainer::CFilterContainer( sal_Int32 initSize ) : // add a name/filter pair //----------------------------------------------------------------------------------------- -sal_Bool SAL_CALL CFilterContainer::addFilter( +sal_Bool SAL_CALL CFilterContainer::addFilter( const OUString& aName, const OUString& aFilter, sal_Bool bAllowDuplicates ) { // check if the filter is already in the container sal_Int32 pos = -1; - + if ( !bAllowDuplicates ) { pos = getFilterTagPos( aName ); @@ -91,7 +91,7 @@ sal_Bool SAL_CALL CFilterContainer::addFilter( //----------------------------------------------------------------------------------------- // delete a filter // Precondition: the container is not empty -// there is a filter identified by the given name +// there is a filter identified by the given name //----------------------------------------------------------------------------------------- sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) @@ -129,14 +129,14 @@ void SAL_CALL CFilterContainer::empty() //----------------------------------------------------------------------------------------- // get a filter by name // Precondition: the container is not empty -// there is a filter identified by the name +// there is a filter identified by the name //----------------------------------------------------------------------------------------- sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& theFilter ) const { OSL_PRECOND( m_vFilters.size() > 0, "Empty filter container" ); - sal_Int32 pos = getFilterTagPos( aName ); + sal_Int32 pos = getFilterTagPos( aName ); try { @@ -153,7 +153,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const @@ -174,7 +174,7 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi } //----------------------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------------------- sal_Int32 SAL_CALL CFilterContainer::getFilterPos( const OUString& aName ) const @@ -189,14 +189,14 @@ sal_Int32 SAL_CALL CFilterContainer::getFilterPos( const OUString& aName ) const sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) const { if ( m_vFilters.size( ) > 0 ) - { + { sal_Int32 i = 0; FILTER_VECTOR_T::const_iterator iter; FILTER_VECTOR_T::const_iterator iter_end = m_vFilters.end( ); for ( iter = m_vFilters.begin( ); iter != iter_end; ++iter, ++i ) if ( ( *iter ).first.equalsIgnoreAsciiCase( aName ) ) - return i; + return i; } return -1; @@ -247,13 +247,13 @@ void SAL_CALL CFilterContainer::setCurrentFilter( const ::rtl::OUString& aName ) //------------------------------------------------------------------- // calculates the length of a '\0' separated filter, that means -// length of the name + '\0' + length of the filter string + +// length of the name + '\0' + length of the filter string + // a trailing '\0' //------------------------------------------------------------------- static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) { - return ( + return ( aFilterEntry.first.getLength( ) + 1 + aFilterEntry.second.getLength( ) + 1 ); } @@ -286,8 +286,8 @@ void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength } //------------------------------------------------------------------- -// a helper trivial helper function to create a filter buffer in the -// format the Win32 API requires, +// a helper trivial helper function to create a filter buffer in the +// format the Win32 API requires, // e.g. "Text\0*.txt\0Doc\0*.doc;*xls\0\0" //------------------------------------------------------------------- @@ -313,11 +313,11 @@ rtl::OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) while( aFilterContainer.getNextFilter( nextFilter ) ) { - _wcsmemcpy( - pBuff + memPos, + _wcsmemcpy( + pBuff + memPos, nextFilter.first.getStr( ), nextFilter.first.getLength( ) ); - + memPos += nextFilter.first.getLength( ) + 1; _wcsmemcpy( |