Kaydet (Commit) aeeb7948 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1296292 merge these two enum types

Change-Id: I4f82ca5f7a6b392322225c0b871dbaffeba44377
üst ee494e4a
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
enum class SvxRedlinDateMode enum class SvxRedlinDateMode
{ {
BEFORE, SINCE, EQUAL, NOTEQUAL, BETWEEN, SAVE BEFORE, SINCE, EQUAL, NOTEQUAL, BETWEEN, SAVE, NONE
}; };
/// Struct for sorting data. /// Struct for sorting data.
......
...@@ -20,13 +20,10 @@ ...@@ -20,13 +20,10 @@
#define INCLUDED_SC_INC_CHGVISET_HXX #define INCLUDED_SC_INC_CHGVISET_HXX
#include <tools/datetime.hxx> #include <tools/datetime.hxx>
#include <svx/ctredlin.hxx>
#include "rangelst.hxx" #include "rangelst.hxx"
#include "scdllapi.h" #include "scdllapi.h"
enum ScChgsDateMode{ SCDM_DATE_BEFORE=0,SCDM_DATE_SINCE=1,SCDM_DATE_EQUAL=2,
SCDM_DATE_NOTEQUAL=3,SCDM_DATE_BETWEEN=4, SCDM_DATE_SAVE=5,
SCDM_NO_DATEMODE=6};
namespace utl { namespace utl {
class TextSearch; class TextSearch;
} }
...@@ -43,7 +40,7 @@ private: ...@@ -43,7 +40,7 @@ private:
OUString aAuthorToShow; OUString aAuthorToShow;
OUString aComment; OUString aComment;
ScRangeList aRangeList; ScRangeList aRangeList;
ScChgsDateMode eDateMode; SvxRedlinDateMode eDateMode;
bool bShowIt; bool bShowIt;
bool bIsDate; bool bIsDate;
bool bIsAuthor; bool bIsAuthor;
...@@ -62,7 +59,7 @@ public: ...@@ -62,7 +59,7 @@ public:
: pCommentSearcher(NULL) : pCommentSearcher(NULL)
, aFirstDateTime(DateTime::EMPTY) , aFirstDateTime(DateTime::EMPTY)
, aLastDateTime(DateTime::EMPTY) , aLastDateTime(DateTime::EMPTY)
, eDateMode(SCDM_DATE_BEFORE) , eDateMode(SvxRedlinDateMode::BEFORE)
, bShowIt(false) , bShowIt(false)
, bIsDate(false) , bIsDate(false)
, bIsAuthor(false) , bIsAuthor(false)
...@@ -87,8 +84,8 @@ public: ...@@ -87,8 +84,8 @@ public:
bool HasDate() const {return bIsDate;} bool HasDate() const {return bIsDate;}
void SetHasDate(bool nFlag) {bIsDate=nFlag;} void SetHasDate(bool nFlag) {bIsDate=nFlag;}
void SetTheDateMode(ScChgsDateMode eDatMod){ eDateMode=eDatMod; } void SetTheDateMode(SvxRedlinDateMode eDatMod){ eDateMode=eDatMod; }
ScChgsDateMode GetTheDateMode() const { return eDateMode; } SvxRedlinDateMode GetTheDateMode() const { return eDateMode; }
void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;} void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;}
const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;} const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;}
......
...@@ -115,13 +115,13 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc ) ...@@ -115,13 +115,13 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc )
{ {
switch ( eDateMode ) switch ( eDateMode )
{ // corresponds with ScViewUtil::IsActionShown { // corresponds with ScViewUtil::IsActionShown
case SCDM_DATE_EQUAL : case SvxRedlinDateMode::EQUAL :
case SCDM_DATE_NOTEQUAL : case SvxRedlinDateMode::NOTEQUAL :
aFirstDateTime.SetTime( 0 ); aFirstDateTime.SetTime( 0 );
aLastDateTime = aFirstDateTime; aLastDateTime = aFirstDateTime;
aLastDateTime.SetTime( 23595999 ); aLastDateTime.SetTime( 23595999 );
break; break;
case SCDM_DATE_SAVE: case SvxRedlinDateMode::SAVE:
{ {
const ScChangeAction* pLast = 0; const ScChangeAction* pLast = 0;
ScChangeTrack* pTrack = rDoc.GetChangeTrack(); ScChangeTrack* pTrack = rDoc.GetChangeTrack();
......
...@@ -2476,7 +2476,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque ...@@ -2476,7 +2476,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque
else if (sName == "ShowChangesByDatetimeMode") else if (sName == "ShowChangesByDatetimeMode")
{ {
if (rChangeProps[i].Value >>= nTemp16) if (rChangeProps[i].Value >>= nTemp16)
pViewSettings->SetTheDateMode(ScChgsDateMode(nTemp16)); pViewSettings->SetTheDateMode(static_cast<SvxRedlinDateMode>(nTemp16));
} }
else if (sName == "ShowChangesByDatetimeFirstDatetime") else if (sName == "ShowChangesByDatetimeFirstDatetime")
{ {
......
...@@ -223,7 +223,7 @@ IMPL_LINK( ScHighlightChgDlg, OKBtnHdl, PushButton*, pOKBtn ) ...@@ -223,7 +223,7 @@ IMPL_LINK( ScHighlightChgDlg, OKBtnHdl, PushButton*, pOKBtn )
{ {
aChangeViewSet.SetShowChanges(m_pHighlightBox->IsChecked()); aChangeViewSet.SetShowChanges(m_pHighlightBox->IsChecked());
aChangeViewSet.SetHasDate(m_pFilterCtr->IsDate()); aChangeViewSet.SetHasDate(m_pFilterCtr->IsDate());
ScChgsDateMode eMode = (ScChgsDateMode) m_pFilterCtr->GetDateMode(); SvxRedlinDateMode eMode = m_pFilterCtr->GetDateMode();
aChangeViewSet.SetTheDateMode( eMode ); aChangeViewSet.SetTheDateMode( eMode );
Date aFirstDate( m_pFilterCtr->GetFirstDate() ); Date aFirstDate( m_pFilterCtr->GetFirstDate() );
tools::Time aFirstTime( m_pFilterCtr->GetFirstTime() ); tools::Time aFirstTime( m_pFilterCtr->GetFirstTime() );
......
...@@ -178,35 +178,35 @@ bool ScViewUtil::IsActionShown( const ScChangeAction& rAction, ...@@ -178,35 +178,35 @@ bool ScViewUtil::IsActionShown( const ScChangeAction& rAction,
if ( !rSettings.GetTheRangeList().Intersects( rAction.GetBigRange().MakeRange() ) ) if ( !rSettings.GetTheRangeList().Intersects( rAction.GetBigRange().MakeRange() ) )
return false; return false;
if ( rSettings.HasDate() && rSettings.GetTheDateMode() != SCDM_NO_DATEMODE ) if (rSettings.HasDate() && rSettings.GetTheDateMode() != SvxRedlinDateMode::NONE)
{ {
DateTime aDateTime = rAction.GetDateTime(); DateTime aDateTime = rAction.GetDateTime();
const DateTime& rFirst = rSettings.GetTheFirstDateTime(); const DateTime& rFirst = rSettings.GetTheFirstDateTime();
const DateTime& rLast = rSettings.GetTheLastDateTime(); const DateTime& rLast = rSettings.GetTheLastDateTime();
switch ( rSettings.GetTheDateMode() ) switch ( rSettings.GetTheDateMode() )
{ // corresponds with ScHighlightChgDlg::OKBtnHdl { // corresponds with ScHighlightChgDlg::OKBtnHdl
case SCDM_DATE_BEFORE: case SvxRedlinDateMode::BEFORE:
if ( aDateTime > rFirst ) if ( aDateTime > rFirst )
return false; return false;
break; break;
case SCDM_DATE_SINCE: case SvxRedlinDateMode::SINCE:
if ( aDateTime < rFirst ) if ( aDateTime < rFirst )
return false; return false;
break; break;
case SCDM_DATE_EQUAL: case SvxRedlinDateMode::EQUAL:
case SCDM_DATE_BETWEEN: case SvxRedlinDateMode::BETWEEN:
if ( aDateTime < rFirst || aDateTime > rLast ) if ( aDateTime < rFirst || aDateTime > rLast )
return false; return false;
break; break;
case SCDM_DATE_NOTEQUAL: case SvxRedlinDateMode::NOTEQUAL:
if ( aDateTime >= rFirst && aDateTime <= rLast ) if ( aDateTime >= rFirst && aDateTime <= rLast )
return false; return false;
break; break;
case SCDM_DATE_SAVE: case SvxRedlinDateMode::SAVE:
{ {
ScChangeTrack* pTrack = rDocument.GetChangeTrack(); ScChangeTrack* pTrack = rDocument.GetChangeTrack();
if ( !pTrack || pTrack->GetLastSavedActionNumber() >= if ( !pTrack || pTrack->GetLastSavedActionNumber() >=
......
...@@ -215,6 +215,8 @@ void SvxRedlinTable::UpdateFilterTest() ...@@ -215,6 +215,8 @@ void SvxRedlinTable::UpdateFilterTest()
aDaTiFilterFirst=aDaTiFirst; aDaTiFilterFirst=aDaTiFirst;
aDaTiFilterLast=aDaTiLast; aDaTiFilterLast=aDaTiLast;
break; break;
case SvxRedlinDateMode::NONE:
break;
} }
} }
...@@ -668,6 +670,8 @@ void SvxTPFilter::ShowDateFields(SvxRedlinDateMode nKind) ...@@ -668,6 +670,8 @@ void SvxTPFilter::ShowDateFields(SvxRedlinDateMode nKind)
EnableDateLine1(false); EnableDateLine1(false);
EnableDateLine2(false); EnableDateLine2(false);
break; break;
case SvxRedlinDateMode::NONE:
break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment