summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-04 20:58:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-05 07:21:22 +0100
commit9bd60e28d8257f2cac1f4e0da89c75336910b197 (patch)
tree5ac4a4cc07e48f2282aa7ba20608e991d258dfad /shell
parentb5d7f596f26e3e086a6584fe69a8bbcc9c51d0bd (diff)
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I8217b1a0b6ccc29052257d54ba7844c0970ad9a4 Reviewed-on: https://gerrit.libreoffice.org/62859 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx27
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx2
2 files changed, 12 insertions, 17 deletions
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index 8f9ac227b137..c36fc6248ca6 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -78,7 +78,7 @@ COooFilter::COooFilter() :
m_lRefs(1),
m_pContentReader(nullptr),
m_pMetaInfoReader(nullptr),
- m_eState(FilteringContent),
+ m_eState(FilterState::FilteringContent),
m_ulUnicodeBufferLen(0),
m_ulUnicodeCharsRead(0),
m_ulPropertyNum(0),
@@ -263,14 +263,14 @@ SCODE STDMETHODCALLTYPE COooFilter::Init(
if ( m_fContents )
{
m_fEof = FALSE;
- m_eState = FilteringContent;
+ m_eState = FilterState::FilteringContent;
m_ulUnicodeCharsRead = 0;
m_ChunkPosition = 0;
}
else
{
m_fEof = TRUE;
- m_eState = FilteringProperty;
+ m_eState = FilterState::FilteringProperty;
}
m_ulChunkID = 1;
}
@@ -307,7 +307,7 @@ SCODE STDMETHODCALLTYPE COooFilter::GetChunk(STAT_CHUNK * pStat)
{
switch ( m_eState )
{
- case FilteringContent:
+ case FilterState::FilteringContent:
{
if( m_ChunkPosition == m_pContentReader ->getChunkBuffer().size() )
{
@@ -317,7 +317,7 @@ SCODE STDMETHODCALLTYPE COooFilter::GetChunk(STAT_CHUNK * pStat)
if ( !m_fContents || m_fEof )
{
- m_eState = FilteringProperty;
+ m_eState = FilterState::FilteringProperty;
continue;
}
m_pwsBuffer = m_pContentReader -> getChunkBuffer()[m_ChunkPosition].second;
@@ -339,7 +339,7 @@ SCODE STDMETHODCALLTYPE COooFilter::GetChunk(STAT_CHUNK * pStat)
m_ChunkPosition++;
return S_OK;
}
- case FilteringProperty:
+ case FilterState::FilteringProperty:
{
if ( m_cAttributes == 0 )
return FILTER_E_END_OF_CHUNKS;
@@ -377,8 +377,6 @@ SCODE STDMETHODCALLTYPE COooFilter::GetChunk(STAT_CHUNK * pStat)
return S_OK;
}
}
- default:
- return E_FAIL;
}//switch(...)
}//for(;;)
}
@@ -401,9 +399,9 @@ SCODE STDMETHODCALLTYPE COooFilter::GetText(ULONG * pcwcBuffer, WCHAR * awcBuffe
{
switch ( m_eState )
{
- case FilteringProperty:
+ case FilterState::FilteringProperty:
return FILTER_E_NO_TEXT;
- case FilteringContent:
+ case FilterState::FilteringContent:
{
if ( !m_fContents || 0 == m_ulUnicodeBufferLen )
{
@@ -425,9 +423,8 @@ SCODE STDMETHODCALLTYPE COooFilter::GetText(ULONG * pcwcBuffer, WCHAR * awcBuffe
}
return S_OK;
}
- default:
- return E_FAIL;
}
+ return E_FAIL; // Should not happen!
}
//M-------------------------------------------------------------------------
// Method: GetMetaInfoNameFromPropertyId
@@ -463,9 +460,9 @@ static ::std::wstring GetMetaInfoNameFromPropertyId( ULONG ulPropID )
SCODE STDMETHODCALLTYPE COooFilter::GetValue(PROPVARIANT ** ppPropValue)
{
- if (m_eState == FilteringContent)
+ if (m_eState == FilterState::FilteringContent)
return FILTER_E_NO_VALUES;
- else if (m_eState == FilteringProperty)
+ else // m_eState == FilteringProperty
{
if ( m_cAttributes == 0 || ( m_ulCurrentPropertyNum == m_ulPropertyNum ) )
return FILTER_E_NO_MORE_VALUES;
@@ -489,8 +486,6 @@ SCODE STDMETHODCALLTYPE COooFilter::GetValue(PROPVARIANT ** ppPropValue)
m_ulCurrentPropertyNum = m_ulPropertyNum;
return S_OK;
}
- else
- return E_FAIL;
}
//M-------------------------------------------------------------------------
// Method: COooFilter::BindRegion (IFilter::BindRegion)
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
index f63b86f956fb..6a793d759f5e 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.hxx
@@ -64,7 +64,7 @@ const CLSID CLSID_PERSISTENT_HANDLER_ADDIN =
const CLSID CLSID_FILTER_HANDLER =
{0x7bc0e710, 0x5703, 0x45be, {0xa2, 0x9d, 0x5d, 0x46, 0xd8, 0xb3, 0x92, 0x62}};
-enum FilterState
+enum class FilterState
{
FilteringContent, // Filtering the content property
FilteringProperty // Filtering the pseudo property