sw/inc/docufld.hxx                  |   48 ++++++++++++++++++------------------
 sw/inc/fldbas.hxx                   |    9 ------
 sw/source/core/access/accpara.cxx   |    2 -
 sw/source/core/fields/docufld.cxx   |   48 ++++++++++++++++++------------------
 sw/source/core/fields/fldbas.cxx    |    2 -
 sw/source/core/unocore/unofield.cxx |    2 -
 sw/source/filter/html/htmlfld.cxx   |   30 +++++++++++-----------
 sw/source/filter/html/htmlfldw.cxx  |   32 ++++++++++++------------
 sw/source/filter/ww8/ww8atr.cxx     |   19 +++++++-------
 sw/source/ui/fldui/flddok.cxx       |    2 -
 sw/source/ui/fldui/fldedt.cxx       |   30 +++++++++++-----------
 sw/source/uibase/fldui/fldmgr.cxx   |    2 -
 12 files changed, 109 insertions(+), 117 deletions(-)

New commits:
commit 53496854ab55adc8c2fa5f568d87ebbfd7fae94a
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Jul 5 19:20:37 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Jul 8 14:32:19 2025 +0200

    SwAttrFieldType is dead
    
    since
      commit 3a87f9b67f3274fe4a02b003c49f893c87291c3d
      Author: Mike Kaganski <mike.kagan...@collabora.com>
      Date:   Wed Oct 25 11:51:13 2023 +0200
      Drop unused SwFieldPortion::m_nAttrFieldType
    
    Change-Id: I1d145670420a04e652ee8f76eb12ca9cd275ab2b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187531
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index cc3ee5321a3b..d0cbf509cda9 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -146,15 +146,6 @@ enum class SwFieldTypesEnum : sal_uInt16 {
     LAST,
     Unknown = USHRT_MAX // used by SwFieldMgr::GetCurTypeId
 };
-enum SwAttrFieldType {
-    ATTR_NONE,
-    ATTR_DATEFLD,
-    ATTR_TIMEFLD,
-    ATTR_PAGENUMBERFLD,
-    ATTR_PAGECOUNTFLD,
-    ATTR_BOOKMARKFLD,
-    ATTR_SETREFATTRFLD
-};
 enum class SwFileNameFormat {
     // most of the constants are a regular enum
     Name,
commit 8db1ef166d71e83d95e086e83d9199351a3803fe
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Jul 5 19:17:05 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Jul 8 14:32:10 2025 +0200

    Convert SwExtUserSubType to scoped enum
    
    Change-Id: I1260a69e5472bdc8ee0846bd8053dd9593cfe28a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187503
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 0aaff9831db4..a423be9beaa8 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -114,25 +114,25 @@ enum class SwPageNumSubType
 // to exactly match the published constants in css::text::UserDataPart
 // (see offapi/com/sun/star/text/UserDataPart.idl).
 
-enum SwExtUserSubType
-{
-    EU_COMPANY,
-    EU_FIRSTNAME,
-    EU_NAME,
-    EU_SHORTCUT,
-    EU_STREET,
-    EU_COUNTRY,
-    EU_ZIP,
-    EU_CITY,
-    EU_TITLE,
-    EU_POSITION,
-    EU_PHONE_PRIVATE,
-    EU_PHONE_COMPANY,
-    EU_FAX,
-    EU_EMAIL,
-    EU_STATE,
-    EU_FATHERSNAME,
-    EU_APARTMENT
+enum class SwExtUserSubType : sal_uInt16
+{
+    Company,
+    Firstname,
+    Name,
+    Shortcut,
+    Street,
+    Country,
+    Zip,
+    City,
+    Title,
+    Position,
+    PhonePrivate,
+    PhoneCompany,
+    Fax,
+    Email,
+    State,
+    FathersName,
+    Apartment
 };
 
 enum class SwJumpEditFormat
@@ -611,18 +611,18 @@ class SwExtUserFieldType final : public SwFieldType
 public:
     SwExtUserFieldType();
 
-    static OUString         Expand(sal_uInt16 nSubType);
+    static OUString         Expand(SwExtUserSubType nSubType);
     virtual std::unique_ptr<SwFieldType> Copy() const override;
 };
 
 class SAL_DLLPUBLIC_RTTI SwExtUserField final : public SwField
 {
     OUString m_aContent;
-    sal_uInt16  m_nType;
+    SwExtUserSubType  m_nType;
     SwAuthorFormat m_nFormat;
 
 public:
-    SwExtUserField(SwExtUserFieldType*, sal_uInt16 nSub, SwAuthorFormat 
nFormat);
+    SwExtUserField(SwExtUserFieldType*, SwExtUserSubType nSub, SwAuthorFormat 
nFormat);
 
     SwAuthorFormat GetFormat() const { return m_nFormat; }
     void SetFormat(SwAuthorFormat n) { m_nFormat = n; }
@@ -630,8 +630,8 @@ public:
     virtual OUString    ExpandImpl(SwRootFrame const* pLayout) const override;
     virtual std::unique_ptr<SwField> Copy() const override;
 
-    SW_DLLPUBLIC sal_uInt16 GetSubType() const;
-    void SetSubType(sal_uInt16 nSub);
+    SW_DLLPUBLIC SwExtUserSubType GetSubType() const;
+    void SetSubType(SwExtUserSubType nSub);
 
     void         SetExpansion(const OUString& rStr) { m_aContent = rStr; }
 
diff --git a/sw/source/core/access/accpara.cxx 
b/sw/source/core/access/accpara.cxx
index 106293fe7180..5224d473baa0 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1087,7 +1087,7 @@ OUString 
SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
         }
         break;
     case SwFieldIds::ExtUser:
-        subType = static_cast<const SwExtUserField*>(pField)->GetSubType();
+        subType = static_cast<sal_uInt16>(static_cast<const 
SwExtUserField*>(pField)->GetSubType());
         break;
     case SwFieldIds::HiddenText:
     case SwFieldIds::SetExp:
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index 2abd189f78a6..c2639ce82234 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2109,29 +2109,29 @@ std::unique_ptr<SwFieldType> SwExtUserFieldType::Copy() 
const
     return std::make_unique<SwExtUserFieldType>();
 }
 
-OUString SwExtUserFieldType::Expand(sal_uInt16 nSub )
+OUString SwExtUserFieldType::Expand(SwExtUserSubType nSub )
 {
     UserOptToken nRet = static_cast<UserOptToken>(USHRT_MAX);
     switch(nSub)
     {
-    case EU_FIRSTNAME:      nRet = UserOptToken::FirstName; break;
-    case EU_NAME:           nRet = UserOptToken::LastName;  break;
-    case EU_SHORTCUT:       nRet = UserOptToken::ID; break;
-
-    case EU_COMPANY:        nRet = UserOptToken::Company;        break;
-    case EU_STREET:         nRet = UserOptToken::Street;         break;
-    case EU_TITLE:          nRet = UserOptToken::Title;          break;
-    case EU_POSITION:       nRet = UserOptToken::Position;       break;
-    case EU_PHONE_PRIVATE:  nRet = UserOptToken::TelephoneHome;    break;
-    case EU_PHONE_COMPANY:  nRet = UserOptToken::TelephoneWork;    break;
-    case EU_FAX:            nRet = UserOptToken::Fax;            break;
-    case EU_EMAIL:          nRet = UserOptToken::Email;          break;
-    case EU_COUNTRY:        nRet = UserOptToken::Country;        break;
-    case EU_ZIP:            nRet = UserOptToken::Zip;            break;
-    case EU_CITY:           nRet = UserOptToken::City;           break;
-    case EU_STATE:          nRet = UserOptToken::State;          break;
-    case EU_FATHERSNAME:    nRet = UserOptToken::FathersName;    break;
-    case EU_APARTMENT:      nRet = UserOptToken::Apartment;      break;
+    case SwExtUserSubType::Firstname:      nRet = UserOptToken::FirstName; 
break;
+    case SwExtUserSubType::Name:           nRet = UserOptToken::LastName;  
break;
+    case SwExtUserSubType::Shortcut:       nRet = UserOptToken::ID; break;
+
+    case SwExtUserSubType::Company:        nRet = UserOptToken::Company;       
 break;
+    case SwExtUserSubType::Street:         nRet = UserOptToken::Street;        
 break;
+    case SwExtUserSubType::Title:          nRet = UserOptToken::Title;         
 break;
+    case SwExtUserSubType::Position:       nRet = UserOptToken::Position;      
 break;
+    case SwExtUserSubType::PhonePrivate:  nRet = UserOptToken::TelephoneHome;  
  break;
+    case SwExtUserSubType::PhoneCompany:  nRet = UserOptToken::TelephoneWork;  
  break;
+    case SwExtUserSubType::Fax:            nRet = UserOptToken::Fax;           
 break;
+    case SwExtUserSubType::Email:          nRet = UserOptToken::Email;         
 break;
+    case SwExtUserSubType::Country:        nRet = UserOptToken::Country;       
 break;
+    case SwExtUserSubType::Zip:            nRet = UserOptToken::Zip;           
 break;
+    case SwExtUserSubType::City:           nRet = UserOptToken::City;          
 break;
+    case SwExtUserSubType::State:          nRet = UserOptToken::State;         
 break;
+    case SwExtUserSubType::FathersName:    nRet = UserOptToken::FathersName;   
 break;
+    case SwExtUserSubType::Apartment:      nRet = UserOptToken::Apartment;     
 break;
     default:             OSL_ENSURE( false, "Field unknown");
     }
     if( static_cast<UserOptToken>(USHRT_MAX) != nRet )
@@ -2144,7 +2144,7 @@ OUString SwExtUserFieldType::Expand(sal_uInt16 nSub )
 
 // extended user information field
 
-SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, 
SwAuthorFormat nFormat) :
+SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, SwExtUserSubType 
nSubTyp, SwAuthorFormat nFormat) :
     SwField(pTyp), m_nType(nSubTyp), m_nFormat(nFormat)
 {
     m_aContent = SwExtUserFieldType::Expand(m_nType);
@@ -2166,12 +2166,12 @@ std::unique_ptr<SwField> SwExtUserField::Copy() const
     return std::unique_ptr<SwField>(pField.release());
 }
 
-sal_uInt16 SwExtUserField::GetSubType() const
+SwExtUserSubType SwExtUserField::GetSubType() const
 {
     return m_nType;
 }
 
-void SwExtUserField::SetSubType(sal_uInt16 nSub)
+void SwExtUserField::SetSubType(SwExtUserSubType nSub)
 {
     m_nType = nSub;
 }
@@ -2186,7 +2186,7 @@ bool SwExtUserField::QueryValue( uno::Any& rAny, 
sal_uInt16 nWhichId ) const
 
     case FIELD_PROP_USHORT1:
         {
-            sal_Int16 nTmp = m_nType;
+            sal_Int16 nTmp = static_cast<sal_uInt16>(m_nType);
             rAny <<= nTmp;
         }
         break;
@@ -2211,7 +2211,7 @@ bool SwExtUserField::PutValue( const uno::Any& rAny, 
sal_uInt16 nWhichId )
         {
             sal_Int16 nTmp = 0;
             rAny >>= nTmp;
-            m_nType = nTmp;
+            m_nType = static_cast<SwExtUserSubType>(nTmp);
         }
         break;
     case FIELD_PROP_BOOL1:
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index bfa4a9fe5801..a65df203158e 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -512,7 +512,7 @@ void SwField::SetUntypedSubType(sal_uInt16 n)
         static_cast<SwSetExpField*>(this)->SetSubType(n);
         break;
     case SwFieldIds::ExtUser:
-        static_cast<SwExtUserField*>(this)->SetSubType(n);
+        
static_cast<SwExtUserField*>(this)->SetSubType(static_cast<SwExtUserSubType>(n));
         break;
     case SwFieldIds::DocInfo:
         
static_cast<SwDocInfoField*>(this)->SetSubType(static_cast<SwDocInfoSubType>(n));
diff --git a/sw/source/core/unocore/unofield.cxx 
b/sw/source/core/unocore/unofield.cxx
index 0da1d062df5a..b53df2ca82c9 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1606,7 +1606,7 @@ void SAL_CALL SwXTextField::attach(
                 SwFieldType* pFieldType = 
pDoc->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::ExtUser);
                 SwExtUserField *const pEUField = new SwExtUserField(
                     static_cast<SwExtUserFieldType*>(pFieldType),
-                    m_pImpl->m_pProps->nUSHORT1, nFormat);
+                    
static_cast<SwExtUserSubType>(m_pImpl->m_pProps->nUSHORT1), nFormat);
                 xField.reset(pEUField);
                 pEUField->SetExpansion(m_pImpl->m_pProps->sPar1);
             }
diff --git a/sw/source/filter/html/htmlfld.cxx 
b/sw/source/filter/html/htmlfld.cxx
index ec0ffe1ac88b..1d85c4966cea 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -110,21 +110,21 @@ HTMLOptionEnum<SvxNumType> const 
aHTMLPageNumFieldFormatTable[] =
 
 HTMLOptionEnum<SwExtUserSubType> const aHTMLExtUsrFieldSubTable[] =
 {
-    { OOO_STRING_SW_HTML_FS_company,     EU_COMPANY },
-    { OOO_STRING_SW_HTML_FS_firstname,   EU_FIRSTNAME },
-    { OOO_STRING_SW_HTML_FS_name,        EU_NAME },
-    { OOO_STRING_SW_HTML_FS_shortcut,    EU_SHORTCUT },
-    { OOO_STRING_SW_HTML_FS_street,      EU_STREET },
-    { OOO_STRING_SW_HTML_FS_country,     EU_COUNTRY },
-    { OOO_STRING_SW_HTML_FS_zip,         EU_ZIP },
-    { OOO_STRING_SW_HTML_FS_city,        EU_CITY },
-    { OOO_STRING_SW_HTML_FS_title,       EU_TITLE },
-    { OOO_STRING_SW_HTML_FS_position,    EU_POSITION },
-    { OOO_STRING_SW_HTML_FS_pphone,      EU_PHONE_PRIVATE },
-    { OOO_STRING_SW_HTML_FS_cphone,      EU_PHONE_COMPANY },
-    { OOO_STRING_SW_HTML_FS_fax,         EU_FAX },
-    { OOO_STRING_SW_HTML_FS_email,       EU_EMAIL },
-    { OOO_STRING_SW_HTML_FS_state,       EU_STATE },
+    { OOO_STRING_SW_HTML_FS_company,     SwExtUserSubType::Company },
+    { OOO_STRING_SW_HTML_FS_firstname,   SwExtUserSubType::Firstname },
+    { OOO_STRING_SW_HTML_FS_name,        SwExtUserSubType::Name },
+    { OOO_STRING_SW_HTML_FS_shortcut,    SwExtUserSubType::Shortcut },
+    { OOO_STRING_SW_HTML_FS_street,      SwExtUserSubType::Street },
+    { OOO_STRING_SW_HTML_FS_country,     SwExtUserSubType::Country },
+    { OOO_STRING_SW_HTML_FS_zip,         SwExtUserSubType::Zip },
+    { OOO_STRING_SW_HTML_FS_city,        SwExtUserSubType::City },
+    { OOO_STRING_SW_HTML_FS_title,       SwExtUserSubType::Title },
+    { OOO_STRING_SW_HTML_FS_position,    SwExtUserSubType::Position },
+    { OOO_STRING_SW_HTML_FS_pphone,      SwExtUserSubType::PhonePrivate },
+    { OOO_STRING_SW_HTML_FS_cphone,      SwExtUserSubType::PhoneCompany },
+    { OOO_STRING_SW_HTML_FS_fax,         SwExtUserSubType::Fax },
+    { OOO_STRING_SW_HTML_FS_email,       SwExtUserSubType::Email },
+    { OOO_STRING_SW_HTML_FS_state,       SwExtUserSubType::State },
     { nullptr,                           SwExtUserSubType(0) }
 };
 
diff --git a/sw/source/filter/html/htmlfldw.cxx 
b/sw/source/filter/html/htmlfldw.cxx
index 13416fad01e2..e79c3847d656 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -89,23 +89,23 @@ static SwHTMLWriter& OutHTML_SwField( SwHTMLWriter& rWrt, 
const SwField* pField,
         {
             auto pExtUserField = static_cast<const SwExtUserField*>(pField);
             pTypeStr = OOO_STRING_SW_HTML_FT_sender;
-            switch( static_cast<SwExtUserSubType>(pExtUserField->GetSubType()) 
)
+            switch( pExtUserField->GetSubType() )
             {
-                case EU_COMPANY:    pSubStr = OOO_STRING_SW_HTML_FS_company;   
     break;
-                case EU_FIRSTNAME:  pSubStr = OOO_STRING_SW_HTML_FS_firstname; 
 break;
-                case EU_NAME:       pSubStr = OOO_STRING_SW_HTML_FS_name;      
 break;
-                case EU_SHORTCUT:   pSubStr = OOO_STRING_SW_HTML_FS_shortcut;  
 break;
-                case EU_STREET:     pSubStr = OOO_STRING_SW_HTML_FS_street;    
 break;
-                case EU_COUNTRY:    pSubStr = OOO_STRING_SW_HTML_FS_country;   
  break;
-                case EU_ZIP:        pSubStr = OOO_STRING_SW_HTML_FS_zip;       
  break;
-                case EU_CITY:       pSubStr = OOO_STRING_SW_HTML_FS_city;      
  break;
-                case EU_TITLE:      pSubStr = OOO_STRING_SW_HTML_FS_title;     
  break;
-                case EU_POSITION:   pSubStr = OOO_STRING_SW_HTML_FS_position;  
  break;
-                case EU_PHONE_PRIVATE:  pSubStr = 
OOO_STRING_SW_HTML_FS_pphone;      break;
-                case EU_PHONE_COMPANY:  pSubStr = 
OOO_STRING_SW_HTML_FS_cphone;      break;
-                case EU_FAX:        pSubStr = OOO_STRING_SW_HTML_FS_fax;       
  break;
-                case EU_EMAIL:      pSubStr = OOO_STRING_SW_HTML_FS_email;     
  break;
-                case EU_STATE:      pSubStr = OOO_STRING_SW_HTML_FS_state;     
  break;
+                case SwExtUserSubType::Company:    pSubStr = 
OOO_STRING_SW_HTML_FS_company;        break;
+                case SwExtUserSubType::Firstname:  pSubStr = 
OOO_STRING_SW_HTML_FS_firstname;  break;
+                case SwExtUserSubType::Name:       pSubStr = 
OOO_STRING_SW_HTML_FS_name;       break;
+                case SwExtUserSubType::Shortcut:   pSubStr = 
OOO_STRING_SW_HTML_FS_shortcut;   break;
+                case SwExtUserSubType::Street:     pSubStr = 
OOO_STRING_SW_HTML_FS_street;     break;
+                case SwExtUserSubType::Country:    pSubStr = 
OOO_STRING_SW_HTML_FS_country;     break;
+                case SwExtUserSubType::Zip:        pSubStr = 
OOO_STRING_SW_HTML_FS_zip;         break;
+                case SwExtUserSubType::City:       pSubStr = 
OOO_STRING_SW_HTML_FS_city;        break;
+                case SwExtUserSubType::Title:      pSubStr = 
OOO_STRING_SW_HTML_FS_title;       break;
+                case SwExtUserSubType::Position:   pSubStr = 
OOO_STRING_SW_HTML_FS_position;    break;
+                case SwExtUserSubType::PhonePrivate:  pSubStr = 
OOO_STRING_SW_HTML_FS_pphone;      break;
+                case SwExtUserSubType::PhoneCompany:  pSubStr = 
OOO_STRING_SW_HTML_FS_cphone;      break;
+                case SwExtUserSubType::Fax:        pSubStr = 
OOO_STRING_SW_HTML_FS_fax;         break;
+                case SwExtUserSubType::Email:      pSubStr = 
OOO_STRING_SW_HTML_FS_email;       break;
+                case SwExtUserSubType::State:      pSubStr = 
OOO_STRING_SW_HTML_FS_state;       break;
                 default:
                     ;
             }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 8a09016fa157..45115c1c3387 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3173,23 +3173,24 @@ void AttributeOutputBase::TextField( const 
SwFormatField& rField )
     case SwFieldIds::ExtUser:
         {
             auto pExtUserField = static_cast<const SwExtUserField*>(pField);
-            const sal_uInt16 nSubType = pExtUserField->GetSubType();
+            const SwExtUserSubType nSubType = pExtUserField->GetSubType();
             ww::eField eField = ww::eNONE;
-            switch (0xFF & nSubType)
+            switch (static_cast<SwExtUserSubType>(0xFF & 
static_cast<sal_uInt16>(nSubType)))
             {
-                case EU_FIRSTNAME:
-                case EU_NAME:
+                case SwExtUserSubType::Firstname:
+                case SwExtUserSubType::Name:
                     eField = ww::eUSERNAME;
                     break;
-                case EU_SHORTCUT:
+                case SwExtUserSubType::Shortcut:
                     eField = ww::eUSERINITIALS;
                     break;
-                case EU_STREET:
-                case EU_COUNTRY:
-                case EU_ZIP:
-                case EU_CITY:
+                case SwExtUserSubType::Street:
+                case SwExtUserSubType::Country:
+                case SwExtUserSubType::Zip:
+                case SwExtUserSubType::City:
                     eField = ww::eUSERADDRESS;
                     break;
+                default: break;
             }
 
             if (eField != ww::eNONE)
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 71a608634001..9b4e3b7b2956 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -251,7 +251,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, TypeHdl, weld::TreeView&, 
void)
                         break;
                     case SwFieldTypesEnum::ExtendedUser:
                         m_xSelectionLB->append(sId, aLst[i]);
-                        if (static_cast<const 
SwExtUserField*>(GetCurField())->GetSubType() == i)
+                        if (static_cast<sal_uInt16>(static_cast<const 
SwExtUserField*>(GetCurField())->GetSubType()) == i)
                             m_xSelectionLB->select_id(sId);
                         break;
                     case SwFieldTypesEnum::DocumentStatistics:
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 6c44739af3f4..ebe3c28a77c4 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -312,21 +312,21 @@ IMPL_LINK_NOARG(SwFieldEditDlg, AddressHdl, 
weld::Button&, void)
         auto pExtUserField = static_cast<const SwExtUserField*>(pCurField);
         switch(pExtUserField->GetSubType())
         {
-            case EU_FIRSTNAME:  nEditPos = EditPosition::FIRSTNAME;  break;
-            case EU_NAME:       nEditPos = EditPosition::LASTNAME;   break;
-            case EU_SHORTCUT:   nEditPos = EditPosition::SHORTNAME;  break;
-            case EU_COMPANY:    nEditPos = EditPosition::COMPANY;    break;
-            case EU_STREET:     nEditPos = EditPosition::STREET;     break;
-            case EU_TITLE:      nEditPos = EditPosition::TITLE;      break;
-            case EU_POSITION:   nEditPos = EditPosition::POSITION;   break;
-            case EU_PHONE_PRIVATE:nEditPos = EditPosition::TELPRIV;  break;
-            case EU_PHONE_COMPANY:nEditPos = EditPosition::TELCOMPANY;   break;
-            case EU_FAX:        nEditPos = EditPosition::FAX;        break;
-            case EU_EMAIL:      nEditPos = EditPosition::EMAIL;      break;
-            case EU_COUNTRY:    nEditPos = EditPosition::COUNTRY;    break;
-            case EU_ZIP:        nEditPos = EditPosition::PLZ;        break;
-            case EU_CITY:       nEditPos = EditPosition::CITY;       break;
-            case EU_STATE:      nEditPos = EditPosition::STATE;      break;
+            case SwExtUserSubType::Firstname:  nEditPos = 
EditPosition::FIRSTNAME;  break;
+            case SwExtUserSubType::Name:       nEditPos = 
EditPosition::LASTNAME;   break;
+            case SwExtUserSubType::Shortcut:   nEditPos = 
EditPosition::SHORTNAME;  break;
+            case SwExtUserSubType::Company:    nEditPos = 
EditPosition::COMPANY;    break;
+            case SwExtUserSubType::Street:     nEditPos = 
EditPosition::STREET;     break;
+            case SwExtUserSubType::Title:      nEditPos = EditPosition::TITLE; 
     break;
+            case SwExtUserSubType::Position:   nEditPos = 
EditPosition::POSITION;   break;
+            case SwExtUserSubType::PhonePrivate:nEditPos = 
EditPosition::TELPRIV;  break;
+            case SwExtUserSubType::PhoneCompany:nEditPos = 
EditPosition::TELCOMPANY;   break;
+            case SwExtUserSubType::Fax:        nEditPos = EditPosition::FAX;   
     break;
+            case SwExtUserSubType::Email:      nEditPos = EditPosition::EMAIL; 
     break;
+            case SwExtUserSubType::Country:    nEditPos = 
EditPosition::COUNTRY;    break;
+            case SwExtUserSubType::Zip:        nEditPos = EditPosition::PLZ;   
     break;
+            case SwExtUserSubType::City:       nEditPos = EditPosition::CITY;  
     break;
+            case SwExtUserSubType::State:      nEditPos = EditPosition::STATE; 
     break;
 
             default:            nEditPos = EditPosition::UNKNOWN;    break;
 
diff --git a/sw/source/uibase/fldui/fldmgr.cxx 
b/sw/source/uibase/fldui/fldmgr.cxx
index f8d679fa4925..adb7a5362fa2 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1216,7 +1216,7 @@ bool SwFieldMgr::InsertField(
 
     case SwFieldTypesEnum::ExtendedUser:
         {
-            sal_uInt16 nSubType = rData.m_nSubType;
+            SwExtUserSubType nSubType = 
static_cast<SwExtUserSubType>(rData.m_nSubType);
             SwExtUserFieldType* pTyp = static_cast<SwExtUserFieldType*>( 
pCurShell->GetFieldType(
                 0, SwFieldIds::ExtUser) );
             pField.reset(new SwExtUserField(pTyp, nSubType, 
static_cast<SwAuthorFormat>(nFormatId)));

Reply via email to