diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-15 09:55:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-15 11:27:50 +0200 |
commit | 359201c9b4ad26fd445688de2c9a1d15f253d37d (patch) | |
tree | f5e10b077d8965a88d4bd3646217f1bfbfac2f8b | |
parent | 8c3b410ae36d3d82e455180c6acbf23f434d6108 (diff) |
convert SvxAuthorType to scoped enum
Change-Id: I990eb35c883ddd417751487435556f584e956374
Reviewed-on: https://gerrit.libreoffice.org/42312
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | editeng/source/items/flditem.cxx | 2 | ||||
-rw-r--r-- | editeng/source/uno/unofield.cxx | 4 | ||||
-rw-r--r-- | include/editeng/flditem.hxx | 6 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdpopup.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgfield.cxx | 6 |
6 files changed, 14 insertions, 12 deletions
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 05146abce0e4..bf9baf91d4ce 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -179,7 +179,7 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe // #92009# pass fixed attribute to constructor SvxAuthorField* pData = new SvxAuthorField( - aFirstName, aLastName, OUString(), bIsFixed ? SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR); + aFirstName, aLastName, OUString(), bIsFixed ? SvxAuthorType::Fix : SvxAuthorType::Var); if (!bIsFixed) { diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 985dbddb3306..94bef5cdae11 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -356,7 +356,7 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > const & xAn mpImpl->msString2 = static_cast<const SvxAuthorField*>(pData)->GetFormatted(); mpImpl->mnInt16 = sal::static_int_cast< sal_Int16 >( static_cast<const SvxAuthorField*>(pData)->GetFormat()); - mpImpl->mbBoolean1 = static_cast<const SvxAuthorField*>(pData)->GetType() == SVXAUTHORTYPE_FIX; + mpImpl->mbBoolean1 = static_cast<const SvxAuthorField*>(pData)->GetType() == SvxAuthorType::Fix; mpImpl->mbBoolean2 = static_cast<const SvxAuthorField*>(pData)->GetFormat() != SvxAuthorFormat::ShortName; break; @@ -474,7 +474,7 @@ SvxFieldData* SvxUnoTextField::CreateFieldData() const throw() // #92009# pass fixed attribute to constructor pData = new SvxAuthorField( aFirstName, aLastName, "", - mpImpl->mbBoolean1 ? SVXAUTHORTYPE_FIX : SVXAUTHORTYPE_VAR ); + mpImpl->mbBoolean1 ? SvxAuthorType::Fix : SvxAuthorType::Var ); if( !mpImpl->mbBoolean2 ) { diff --git a/include/editeng/flditem.hxx b/include/editeng/flditem.hxx index b86916aa59f2..50956528dcef 100644 --- a/include/editeng/flditem.hxx +++ b/include/editeng/flditem.hxx @@ -327,7 +327,9 @@ public: }; -enum SvxAuthorType { SVXAUTHORTYPE_FIX, SVXAUTHORTYPE_VAR }; +enum class SvxAuthorType { + Fix, Var +}; enum class SvxAuthorFormat { FullName, // full name LastName, // Only Last name @@ -350,7 +352,7 @@ public: const OUString& rFirstName, const OUString& rLastName, const OUString& rShortName, - SvxAuthorType eType = SVXAUTHORTYPE_VAR, + SvxAuthorType eType = SvxAuthorType::Var, SvxAuthorFormat eFormat = SvxAuthorFormat::FullName ); SvxAuthorType GetType() const { return eType; } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 954c49cf09db..293f7672948f 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -202,7 +202,7 @@ IMPL_LINK(SdModule, CalcFieldValueHdl, EditFieldInfo*, pInfo, void) } else if( (pAuthorField = dynamic_cast< const SvxAuthorField* >( pField )) != nullptr ) { - if( pAuthorField->GetType() != SVXAUTHORTYPE_FIX ) + if( pAuthorField->GetType() != SvxAuthorType::Fix ) { SvtUserOptions aUserOptions; SvxAuthorField aAuthorField( diff --git a/sd/source/ui/app/sdpopup.cxx b/sd/source/ui/app/sdpopup.cxx index 0f0efa786622..7bb783418831 100644 --- a/sd/source/ui/app/sdpopup.cxx +++ b/sd/source/ui/app/sdpopup.cxx @@ -143,7 +143,7 @@ void SdFieldPopup::Fill( LanguageType eLanguage ) const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorField aAuthorField( *pAuthorField ); - if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX ) + if( pAuthorField->GetType() == SvxAuthorType::Fix ) CheckItem( 1 ); else CheckItem( 2 ); @@ -280,9 +280,9 @@ SvxFieldData* SdFieldPopup::GetField() sal_uInt16 i; if( IsItemChecked( 1 ) ) - eType = SVXAUTHORTYPE_FIX; + eType = SvxAuthorType::Fix; else - eType = SVXAUTHORTYPE_VAR; + eType = SvxAuthorType::Var; for( i = 3; i <= nCount; i++ ) { diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx index 047d2fab0b4a..a824ed495866 100644 --- a/sd/source/ui/dlg/dlgfield.cxx +++ b/sd/source/ui/dlg/dlgfield.cxx @@ -149,9 +149,9 @@ SvxFieldData* SdModifyFieldDlg::GetField() SvxAuthorFormat eFormat; if( m_pRbtFix->IsChecked() ) - eType = SVXAUTHORTYPE_FIX; + eType = SvxAuthorType::Fix; else - eType = SVXAUTHORTYPE_VAR; + eType = SvxAuthorType::Var; eFormat = (SvxAuthorFormat) ( m_pLbFormat->GetSelectEntryPos() ); @@ -294,7 +294,7 @@ void SdModifyFieldDlg::FillControls() const SvxAuthorField* pAuthorField = static_cast<const SvxAuthorField*>(pField); SvxAuthorField aAuthorField( *pAuthorField ); - if( pAuthorField->GetType() == SVXAUTHORTYPE_FIX ) + if( pAuthorField->GetType() == SvxAuthorType::Fix ) m_pRbtFix->Check(); else m_pRbtVar->Check(); |