diff options
Diffstat (limited to 'fpicker/source/win32/filepicker/FilterContainer.cxx')
-rw-r--r-- | fpicker/source/win32/filepicker/FilterContainer.cxx | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/fpicker/source/win32/filepicker/FilterContainer.cxx b/fpicker/source/win32/filepicker/FilterContainer.cxx index 53d1e51f2c73..1ca694643b1e 100644 --- a/fpicker/source/win32/filepicker/FilterContainer.cxx +++ b/fpicker/source/win32/filepicker/FilterContainer.cxx @@ -31,14 +31,14 @@ #pragma warning(pop) #endif -//------------------------------------------------------------------- + // namespace directives -//------------------------------------------------------------------- -//------------------------------------------------------------------------------------- + + // ctor -//------------------------------------------------------------------------------------- + CFilterContainer::CFilterContainer( sal_Int32 initSize ) : m_vFilters( initSize ), @@ -46,9 +46,9 @@ CFilterContainer::CFilterContainer( sal_Int32 initSize ) : { } -//----------------------------------------------------------------------------------------- + // add a name/filter pair -//----------------------------------------------------------------------------------------- + sal_Bool SAL_CALL CFilterContainer::addFilter( const OUString& aName, const OUString& aFilter, sal_Bool bAllowDuplicates ) @@ -74,11 +74,11 @@ sal_Bool SAL_CALL CFilterContainer::addFilter( return ( pos < 0 ) ? sal_True : sal_False; } -//----------------------------------------------------------------------------------------- + // 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 ) { @@ -94,29 +94,29 @@ sal_Bool SAL_CALL CFilterContainer::delFilter( const OUString& aName ) return ( pos > -1 ) ? sal_True : sal_False; } -//----------------------------------------------------------------------------------------- + // return the number of filters currently in the container -//----------------------------------------------------------------------------------------- + sal_Int32 SAL_CALL CFilterContainer::numFilter( ) { return m_vFilters.size( ); } -//----------------------------------------------------------------------------------------- + // clear all entries -//----------------------------------------------------------------------------------------- + void SAL_CALL CFilterContainer::empty() { m_vFilters.clear( ); } -//----------------------------------------------------------------------------------------- + // get a filter by name // 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 { @@ -138,9 +138,9 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( const OUString& aName, OUString& return (pos > -1 ) ? sal_True : sal_False; } -//----------------------------------------------------------------------------------------- + // -//----------------------------------------------------------------------------------------- + sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFilter ) const { @@ -159,18 +159,18 @@ sal_Bool SAL_CALL CFilterContainer::getFilter( sal_Int32 aIndex, OUString& theFi return bRet; } -//----------------------------------------------------------------------------------------- + // -//----------------------------------------------------------------------------------------- + sal_Int32 SAL_CALL CFilterContainer::getFilterPos( const OUString& aName ) const { return getFilterTagPos( aName ); } -//----------------------------------------------------------------------------------------- + // returns the index of the filter identified by name -//----------------------------------------------------------------------------------------- + sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) const { @@ -188,9 +188,9 @@ sal_Int32 SAL_CALL CFilterContainer::getFilterTagPos( const OUString& aName ) co return -1; } -//----------------------------------------------------------------------------------------- + // starts enumerating the filter in the container -//----------------------------------------------------------------------------------------- + void SAL_CALL CFilterContainer::beginEnumFilter( ) { @@ -198,9 +198,9 @@ void SAL_CALL CFilterContainer::beginEnumFilter( ) m_bIterInitialized = sal_True; } -//----------------------------------------------------------------------------------------- + // returns true if another filter has been retrieved -//----------------------------------------------------------------------------------------- + sal_Bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEntry ) { @@ -216,13 +216,13 @@ sal_Bool SAL_CALL CFilterContainer::getNextFilter( FILTER_ENTRY_T& nextFilterEnt return bRet; } -//----------------------------------------------------------------------------------------- + void SAL_CALL CFilterContainer::setCurrentFilter( const OUString& aName ) { m_sCurrentFilter = aName; } -//----------------------------------------------------------------------------------------- + OUString SAL_CALL CFilterContainer::getCurrentFilter() const { return m_sCurrentFilter; @@ -231,11 +231,11 @@ OUString SAL_CALL CFilterContainer::getCurrentFilter() const //################################################################### -//------------------------------------------------------------------- + // calculates the length of a '\0' separated filter, that means // length of the name + '\0' + length of the filter string + // a trailing '\0' -//------------------------------------------------------------------- + static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntry ) { @@ -244,9 +244,9 @@ static sal_uInt32 _getLengthFilter( CFilterContainer::FILTER_ENTRY_T aFilterEntr aFilterEntry.second.getLength( ) + 1 ); } -//------------------------------------------------------------------- + // calculates the length of all filters currently in the container -//------------------------------------------------------------------- + static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) { @@ -261,9 +261,9 @@ static sal_uInt32 _getTotalFilterLength( CFilterContainer& aFilterContainer ) return ( totalLength > 0 ) ? totalLength + 1 : totalLength; } -//------------------------------------------------------------------- + // -//------------------------------------------------------------------- + inline void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength ) @@ -271,11 +271,11 @@ void _wcsmemcpy( sal_Unicode* pDest, const sal_Unicode* pSrc, sal_uInt32 nLength memcpy( pDest, pSrc, nLength * sizeof( sal_Unicode ) ); } -//------------------------------------------------------------------- + // 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" -//------------------------------------------------------------------- + OUString SAL_CALL makeWinFilterBuffer( CFilterContainer& aFilterContainer ) { |