diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-10-19 12:03:01 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-10-19 14:52:15 +0200 |
commit | d0777b400c48867da3a26313949093efeb8787eb (patch) | |
tree | 293e26f3311721b2796887b7366d69e7b9df8cc7 /sc | |
parent | 22a2ed832bae50f85a254f0604d375aeca207c9e (diff) |
Turn ScStyleSheet::Usage into scoped enum
...to avoid -Werror,-Wshadow from Clang trunk with
<https://reviews.llvm.org/D52400> "Improve -Wshadow warnings with enumerators",
warning about shadowing of USAGE in e.g. enum ESCHER_BlibType in
include/filter/msfilter/escherex.hxx
Change-Id: If492c5086402e46158d3de5d4d6b00b61412c655
Reviewed-on: https://gerrit.libreoffice.org/61985
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/stlsheet.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/attarray.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/stlsheet.cxx | 10 |
4 files changed, 11 insertions, 11 deletions
diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx index b1b4ad68e7c7..bd5aa843d8b4 100644 --- a/sc/inc/stlsheet.hxx +++ b/sc/inc/stlsheet.hxx @@ -32,7 +32,7 @@ friend class ScStyleSheetPool; public: - enum Usage + enum class Usage { UNKNOWN, USED, diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 5c3d5a7153ab..e5c3f3534e55 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1850,7 +1850,7 @@ bool ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const const ScStyleSheet* pStyle = pDocument->GetDefPattern()->GetStyleSheet(); if ( pStyle ) { - pStyle->SetUsage( ScStyleSheet::USED ); + pStyle->SetUsage( ScStyleSheet::Usage::USED ); if ( pStyle == &rStyle ) return true; } @@ -1865,7 +1865,7 @@ bool ScAttrArray::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const const ScStyleSheet* pStyle = mvData[nPos].pPattern->GetStyleSheet(); if ( pStyle ) { - pStyle->SetUsage( ScStyleSheet::USED ); + pStyle->SetUsage( ScStyleSheet::Usage::USED ); if ( pStyle == &rStyle ) { bIsUsed = true; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 490cb93e59a4..4a9b7fb93c3e 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -4967,7 +4967,7 @@ void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool b bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const { - if ( bStyleSheetUsageInvalid || rStyle.GetUsage() == ScStyleSheet::UNKNOWN ) + if ( bStyleSheetUsageInvalid || rStyle.GetUsage() == ScStyleSheet::Usage::UNKNOWN ) { SfxStyleSheetIterator aIter( mxPoolHelper->GetStylePool(), SfxStyleFamily::Para ); @@ -4977,7 +4977,7 @@ bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const if (pStyle->isScStyleSheet()) { const ScStyleSheet* pScStyle = static_cast<const ScStyleSheet*>( pStyle ); - pScStyle->SetUsage( ScStyleSheet::NOTUSED ); + pScStyle->SetUsage( ScStyleSheet::Usage::NOTUSED ); } } @@ -4999,7 +4999,7 @@ bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const return bIsUsed; } - return rStyle.GetUsage() == ScStyleSheet::USED; + return rStyle.GetUsage() == ScStyleSheet::Usage::USED; } bool ScDocument::ApplyFlagsTab( SCCOL nStartCol, SCROW nStartRow, diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 21c24e4ec913..3597205aa829 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -54,13 +54,13 @@ ScStyleSheet::ScStyleSheet( const OUString& rName, SfxStyleSearchBits nMaskP ) : SfxStyleSheet ( rName, rPoolP, eFamily, nMaskP ) - , eUsage( UNKNOWN ) + , eUsage( Usage::UNKNOWN ) { } ScStyleSheet::ScStyleSheet( const ScStyleSheet& rStyle ) : SfxStyleSheet ( rStyle ) - , eUsage( UNKNOWN ) + , eUsage( Usage::UNKNOWN ) { } @@ -261,10 +261,10 @@ bool ScStyleSheet::IsUsed() const // and store the state. ScDocument* pDoc = static_cast<ScStyleSheetPool*>(m_pPool)->GetDocument(); if ( pDoc && pDoc->IsStyleSheetUsed( *this ) ) - eUsage = USED; + eUsage = Usage::USED; else - eUsage = NOTUSED; - return eUsage == USED; + eUsage = Usage::NOTUSED; + return eUsage == Usage::USED; } else return true; |