diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-05-01 12:50:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-01 12:51:01 +0100 |
commit | aeeb79486305efa46ea76d1041b6c9a9c745bfea (patch) | |
tree | 240f56e4c19c5ec9a11c299d03338e764baf4a70 /sc | |
parent | ee494e4a157cdcb016e45fa5cb52604f29e074d9 (diff) |
coverity#1296292 merge these two enum types
Change-Id: I4f82ca5f7a6b392322225c0b871dbaffeba44377
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chgviset.hxx | 13 | ||||
-rw-r--r-- | sc/source/core/tool/chgviset.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/highred.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewutil.cxx | 14 |
5 files changed, 17 insertions, 20 deletions
diff --git a/sc/inc/chgviset.hxx b/sc/inc/chgviset.hxx index aa66f760d3d3..55440e8bd639 100644 --- a/sc/inc/chgviset.hxx +++ b/sc/inc/chgviset.hxx @@ -20,13 +20,10 @@ #define INCLUDED_SC_INC_CHGVISET_HXX #include <tools/datetime.hxx> +#include <svx/ctredlin.hxx> #include "rangelst.hxx" #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 { class TextSearch; } @@ -43,7 +40,7 @@ private: OUString aAuthorToShow; OUString aComment; ScRangeList aRangeList; - ScChgsDateMode eDateMode; + SvxRedlinDateMode eDateMode; bool bShowIt; bool bIsDate; bool bIsAuthor; @@ -62,7 +59,7 @@ public: : pCommentSearcher(NULL) , aFirstDateTime(DateTime::EMPTY) , aLastDateTime(DateTime::EMPTY) - , eDateMode(SCDM_DATE_BEFORE) + , eDateMode(SvxRedlinDateMode::BEFORE) , bShowIt(false) , bIsDate(false) , bIsAuthor(false) @@ -87,8 +84,8 @@ public: bool HasDate() const {return bIsDate;} void SetHasDate(bool nFlag) {bIsDate=nFlag;} - void SetTheDateMode(ScChgsDateMode eDatMod){ eDateMode=eDatMod; } - ScChgsDateMode GetTheDateMode() const { return eDateMode; } + void SetTheDateMode(SvxRedlinDateMode eDatMod){ eDateMode=eDatMod; } + SvxRedlinDateMode GetTheDateMode() const { return eDateMode; } void SetTheFirstDateTime(const DateTime& aDateTime) {aFirstDateTime=aDateTime;} const DateTime& GetTheFirstDateTime()const {return aFirstDateTime;} diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index 01f830c2ccf7..0526c64d44ac 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -115,13 +115,13 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc ) { switch ( eDateMode ) { // corresponds with ScViewUtil::IsActionShown - case SCDM_DATE_EQUAL : - case SCDM_DATE_NOTEQUAL : + case SvxRedlinDateMode::EQUAL : + case SvxRedlinDateMode::NOTEQUAL : aFirstDateTime.SetTime( 0 ); aLastDateTime = aFirstDateTime; aLastDateTime.SetTime( 23595999 ); break; - case SCDM_DATE_SAVE: + case SvxRedlinDateMode::SAVE: { const ScChangeAction* pLast = 0; ScChangeTrack* pTrack = rDoc.GetChangeTrack(); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 695f84799136..5823cd3c42fc 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2476,7 +2476,7 @@ void ScXMLImport::SetChangeTrackingViewSettings(const com::sun::star::uno::Seque else if (sName == "ShowChangesByDatetimeMode") { if (rChangeProps[i].Value >>= nTemp16) - pViewSettings->SetTheDateMode(ScChgsDateMode(nTemp16)); + pViewSettings->SetTheDateMode(static_cast<SvxRedlinDateMode>(nTemp16)); } else if (sName == "ShowChangesByDatetimeFirstDatetime") { diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 8141ca08aa03..6d7562046441 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -223,7 +223,7 @@ IMPL_LINK( ScHighlightChgDlg, OKBtnHdl, PushButton*, pOKBtn ) { aChangeViewSet.SetShowChanges(m_pHighlightBox->IsChecked()); aChangeViewSet.SetHasDate(m_pFilterCtr->IsDate()); - ScChgsDateMode eMode = (ScChgsDateMode) m_pFilterCtr->GetDateMode(); + SvxRedlinDateMode eMode = m_pFilterCtr->GetDateMode(); aChangeViewSet.SetTheDateMode( eMode ); Date aFirstDate( m_pFilterCtr->GetFirstDate() ); tools::Time aFirstTime( m_pFilterCtr->GetFirstTime() ); diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 4c82a4f49c24..b70211e40395 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -178,35 +178,35 @@ bool ScViewUtil::IsActionShown( const ScChangeAction& rAction, if ( !rSettings.GetTheRangeList().Intersects( rAction.GetBigRange().MakeRange() ) ) return false; - if ( rSettings.HasDate() && rSettings.GetTheDateMode() != SCDM_NO_DATEMODE ) + if (rSettings.HasDate() && rSettings.GetTheDateMode() != SvxRedlinDateMode::NONE) { DateTime aDateTime = rAction.GetDateTime(); const DateTime& rFirst = rSettings.GetTheFirstDateTime(); const DateTime& rLast = rSettings.GetTheLastDateTime(); switch ( rSettings.GetTheDateMode() ) { // corresponds with ScHighlightChgDlg::OKBtnHdl - case SCDM_DATE_BEFORE: + case SvxRedlinDateMode::BEFORE: if ( aDateTime > rFirst ) return false; break; - case SCDM_DATE_SINCE: + case SvxRedlinDateMode::SINCE: if ( aDateTime < rFirst ) return false; break; - case SCDM_DATE_EQUAL: - case SCDM_DATE_BETWEEN: + case SvxRedlinDateMode::EQUAL: + case SvxRedlinDateMode::BETWEEN: if ( aDateTime < rFirst || aDateTime > rLast ) return false; break; - case SCDM_DATE_NOTEQUAL: + case SvxRedlinDateMode::NOTEQUAL: if ( aDateTime >= rFirst && aDateTime <= rLast ) return false; break; - case SCDM_DATE_SAVE: + case SvxRedlinDateMode::SAVE: { ScChangeTrack* pTrack = rDocument.GetChangeTrack(); if ( !pTrack || pTrack->GetLastSavedActionNumber() >= |