diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-10 09:35:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-10 10:02:45 +0100 |
commit | a999422d4c83fa32abf0adee7286b9f6fdffa3e9 (patch) | |
tree | d45e8b69ab16f94a1ab6e932e44865c7642526ee /framework | |
parent | 0770b6cc2034851cf46dff66bc446f47e7d57846 (diff) |
loplugin: unused O[U]Strings and misleading else placement
Change-Id: Ifa11ada39c8d4ca29e3c90db18e5bbe618634131
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/queries.h | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/framework/inc/queries.h b/framework/inc/queries.h index bba7c18c31f5..97d12fa656cb 100644 --- a/framework/inc/queries.h +++ b/framework/inc/queries.h @@ -249,20 +249,30 @@ class QueryAnalyzer // Analyze query ... // Try to find base of it and safe it for faster access as enum value! - sal_Int32 nToken = 0; - ::rtl::OUString sParam ; - ::rtl::OUString sBase = sNewQuery.getToken( 0, SEPERATOR_QUERYPARAM, nToken ); - - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_ALL ) == sal_True ) m_eQuery = E_ALL ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_WRITER ) == sal_True ) m_eQuery = E_WRITER ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_WEB ) == sal_True ) m_eQuery = E_WEB ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_GLOBAL ) == sal_True ) m_eQuery = E_GLOBAL ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_CHART ) == sal_True ) m_eQuery = E_CHART ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_CALC ) == sal_True ) m_eQuery = E_CALC ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_IMPRESS ) == sal_True ) m_eQuery = E_IMPRESS ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_DRAW ) == sal_True ) m_eQuery = E_DRAW ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_MATH ) == sal_True ) m_eQuery = E_MATH ; else - if( sBase.equalsIgnoreAsciiCase( BASE_QUERY_GRAPHICS ) == sal_True ) m_eQuery = E_GRAPHICS ; + sal_Int32 nToken = 0; + OUString sParam; + OUString sBase = sNewQuery.getToken( 0, SEPERATOR_QUERYPARAM, nToken ); + + if (sBase.equalsIgnoreAsciiCase(BASE_QUERY_ALL)) + m_eQuery = E_ALL; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_WRITER)) + m_eQuery = E_WRITER; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_WEB)) + m_eQuery = E_WEB; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_GLOBAL)) + m_eQuery = E_GLOBAL; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_CHART)) + m_eQuery = E_CHART; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_CALC)) + m_eQuery = E_CALC; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_IMPRESS)) + m_eQuery = E_IMPRESS; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_DRAW)) + m_eQuery = E_DRAW; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_MATH)) + m_eQuery = E_MATH; + else if( sBase.equalsIgnoreAsciiCase(BASE_QUERY_GRAPHICS)) + m_eQuery = E_GRAPHICS; // Try to get additional parameters ... while( nToken >= 0 ) @@ -296,7 +306,7 @@ class QueryAnalyzer if( sParam.compareTo( QUERYPARAM_IFLAGS, QUERYPARAM_IFLAGS.getLength() ) == 0 ) { sal_Int32 nSubToken = 0; - ::rtl::OUString sParamName = sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); + sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); if( nSubToken > 0 ) { m_nIFlags = sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ).toInt32(); @@ -307,7 +317,7 @@ class QueryAnalyzer if( sParam.compareTo( QUERYPARAM_EFLAGS, QUERYPARAM_EFLAGS.getLength() ) == 0 ) { sal_Int32 nSubToken = 0; - ::rtl::OUString sParamName = sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); + sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); if( nSubToken > 0 ) { m_nEFlags = sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ).toInt32(); @@ -318,7 +328,7 @@ class QueryAnalyzer if( sParam.compareTo( QUERYPARAM_SORT_PROP, QUERYPARAM_SORT_PROP.getLength() ) == 0 ) { sal_Int32 nSubToken = 0; - ::rtl::OUString sParamName = sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); + sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); if( nSubToken > 0 ) { ::rtl::OUString sParamValue = sParam.getToken( 0, SEPERATOR_QUERYPARAMVALUE, nSubToken ); |